Check the return type of copy_from_user
parent
3a043ecedd
commit
17569a82a9
|
|
@ -592,11 +592,13 @@ static long intrepid_dev_ioctl(struct file *fp, unsigned int cmd, unsigned long
|
||||||
struct intrepid_netdevice *result = NULL;
|
struct intrepid_netdevice *result = NULL;
|
||||||
char requestedNameBuffer[IFALIASZ] = {0};
|
char requestedNameBuffer[IFALIASZ] = {0};
|
||||||
char* requestedName = NULL;
|
char* requestedName = NULL;
|
||||||
|
int bytesNotCopied = 0;
|
||||||
if ((void __user*)arg != NULL) {
|
if ((void __user*)arg != NULL) {
|
||||||
copy_from_user(requestedNameBuffer, (void __user*)arg, IFALIASZ);
|
bytesNotCopied = copy_from_user(requestedNameBuffer, (void __user*)arg, IFALIASZ);
|
||||||
|
if(bytesNotCopied != 0)
|
||||||
|
pr_warn("intrepid: %d bytes not copied for alias", bytesNotCopied);
|
||||||
requestedName = requestedNameBuffer;
|
requestedName = requestedNameBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = intrepid_add_can_if(&result, requestedName);
|
ret = intrepid_add_can_if(&result, requestedName);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue