]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
watchdog: rc32434_wdt: fix ioctl error handling
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 28 Feb 2016 15:44:09 +0000 (17:44 +0200)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 18 Apr 2016 12:50:44 +0000 (08:50 -0400)
commit58d550f06dfefe06ae1afed7a2ffaa333d19dfec
treee4b3ff1403956d09cd40b7a7acb2261723353de1
parent463c16b5e65df60c9404e0755378a85f581a3145
watchdog: rc32434_wdt: fix ioctl error handling

[ Upstream commit 10e7ac22cdd4d211cef99afcb9371b70cb175be6 ]

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: Sasha Levin <sasha.levin@oracle.com>
drivers/watchdog/rc32434_wdt.c