]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.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)
committerTim Gardner <tim.gardner@canonical.com>
Thu, 21 Apr 2016 12:53:04 +0000 (06:53 -0600)
commit60e6d603d277e3194eac899d02a55a0ea061c41c
tree7e05e4cb07fefdced41ea2dc36f2ffb7f3bdba1b
parent53ead2dda734ce6c948db01fbc319d71cf0e64ef
watchdog: rc32434_wdt: fix ioctl error handling

BugLink: http://bugs.launchpad.net/bugs/1572722
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.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/watchdog/rc32434_wdt.c