提交 25477f23 编写于 作者: D Dan Carpenter 提交者: Greg Kroah-Hartman

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: NDan Carpenter <error27@gmail.com>
Signed-off-by: NSven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 f2102d31
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册