mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 15:07:13 -04:00
staging: pi433: return -EFAULT if copy_to_user() fails
copy_to_user() to user returns the number of bytes that weren't copied,
but we should be returning -EFAULT to the user.
Fixes: 874bcba65f ("staging: pi433: New driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a7b1ba2355
commit
39ae5f1e4b
@@ -689,7 +689,7 @@ pi433_read(struct file *filp, char __user *buf, size_t size, loff_t *f_pos)
|
||||
{
|
||||
retval = copy_to_user(buf, device->rx_buffer, bytes_received);
|
||||
if (retval)
|
||||
return retval;
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
return bytes_received;
|
||||
|
||||
Reference in New Issue
Block a user