ip2: return -EFAULT on copy_to_user errors
authorDan Carpenter <error27@gmail.com>
Thu, 12 Aug 2010 20:48:59 +0000 (13:48 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 24 Aug 2010 01:17:21 +0000 (18:17 -0700)
commit05254a207a255e1a76f9b349a783b5016b874d72
tree13d95f3956978e1e8e347be48b565cdf5b661c89
parentf64ac9830b2a2455208ee023f6bac480ae159db4
ip2: return -EFAULT on copy_to_user errors

copy_to_user() returns the number of bytes remaining but we want to return
a negative error code on errors.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: "Michael H. Warfield" <mhw@wittsend.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/char/ip2/ip2main.c