watchdog: rc32434_wdt: fix ioctl error handling
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 28 Feb 2016 15:44:09 +0000 (17:44 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Jun 2016 08:42:46 +0000 (10:42 +0200)
commit9bd0caf31ca013ed42e4a00dd2872035975e5b04
treeff268ebc69fa8a299c090c1c8478689c897444ff
parentf5b0d85307a93e081aa254c9cb28a44de8ff8e81
watchdog: rc32434_wdt: fix ioctl error handling

commit 10e7ac22cdd4d211cef99afcb9371b70cb175be6 upstream.

Calling return copy_to_user(...) in an ioctl will not do the right thing
if there's a pagefault: copy_to_user returns the number of bytes not
copied in this case.

Fix up watchdog/rc32434_wdt to do
return copy_to_user(...)) ?  -EFAULT : 0;

instead.

Cc: stable@vger.kernel.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/watchdog/rc32434_wdt.c