Commit 53ef8f80 authored by Randy Dunlap's avatar Randy Dunlap Committed by Greg Kroah-Hartman

[PATCH] jantior: return -EFAULT on copy_user error

From: Daniele Bellucci <bellucda@tiscali.it>

Return proper error code from copy_to_user failure in fs/sysfs/bin.c
parent d9bc3929
......@@ -47,8 +47,8 @@ read(struct file * file, char __user * userbuf, size_t count, loff_t * off)
return ret;
count = ret;
if (copy_to_user(userbuf, buffer + offs, count) != 0)
return -EINVAL;
if (copy_to_user(userbuf, buffer + offs, count))
return -EFAULT;
pr_debug("offs = %lld, *off = %lld, count = %zd\n", offs, *off, count);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment