forked from Minki/linux
Staging: batman-adv: return -EFAULT on copy_to_user errors
copy_to_user() returns the number of bites remaining but we want to return a negative error code here. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
e6dc269b40
commit
cf2d3fc978
@ -196,7 +196,7 @@ ssize_t bat_device_read(struct file *file, char __user *buf, size_t count,
|
||||
kfree(device_packet);
|
||||
|
||||
if (error)
|
||||
return error;
|
||||
return -EFAULT;
|
||||
|
||||
return sizeof(struct icmp_packet);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user