kernel: simplify sysnotify; should fix CID 156151 (Wrong sizeof argument)

This commit is contained in:
Giacomo Tesio 2017-08-14 19:52:22 +02:00
parent 17c9087965
commit b056df2da6
1 changed files with 3 additions and 6 deletions

View File

@ -689,16 +689,13 @@ syserrstr(char* err, int nerr)
int
sysnotify(void* a0)
{
void (*f)(void*, char*);
if(a0 != nil)
validaddr(a0, sizeof(void*), 0);
/*
* int notify(void (*f)(void*, char*));
*/
f = (void (*)(void*, char*))a0;
if(f != nil)
validaddr(f, sizeof(void (*)(void*, char*)), 0);
up->notify = f;
up->notify = (void (*)(void*, char*))a0;
return 0;
}