summaryrefslogtreecommitdiff
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorTiejun Chen <tiejun.chen@windriver.com>2012-08-07 09:59:40 +0800
committerKumar Gala <galak@kernel.crashing.org>2012-08-17 09:03:51 -0500
commit127c6e731106a2071ee4a6c5a34c471cd3e719f0 (patch)
treed76424da3d06c61a8395ddb4660d912bdab59ce6 /drivers/watchdog
parent09a3017a585eb8567a7de15b426bb1dfb548bf0f (diff)
downloadlinux-stable-127c6e731106a2071ee4a6c5a34c471cd3e719f0.tar.gz
linux-stable-127c6e731106a2071ee4a6c5a34c471cd3e719f0.tar.bz2
linux-stable-127c6e731106a2071ee4a6c5a34c471cd3e719f0.zip
booke/wdt: some ioctls do not return values properly
Fix some booke wdt ioctls return value error. Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com> Acked-by: Timur Tabi <timur@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/booke_wdt.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
index 3fe82d0e8caa..5b06d31ab6a9 100644
--- a/drivers/watchdog/booke_wdt.c
+++ b/drivers/watchdog/booke_wdt.c
@@ -166,18 +166,17 @@ static long booke_wdt_ioctl(struct file *file,
switch (cmd) {
case WDIOC_GETSUPPORT:
- if (copy_to_user((void *)arg, &ident, sizeof(ident)))
- return -EFAULT;
+ return copy_to_user(p, &ident, sizeof(ident)) ? -EFAULT : 0;
case WDIOC_GETSTATUS:
return put_user(0, p);
case WDIOC_GETBOOTSTATUS:
/* XXX: something is clearing TSR */
tmp = mfspr(SPRN_TSR) & TSR_WRS(3);
/* returns CARDRESET if last reset was caused by the WDT */
- return (tmp ? WDIOF_CARDRESET : 0);
+ return put_user((tmp ? WDIOF_CARDRESET : 0), p);
case WDIOC_SETOPTIONS:
if (get_user(tmp, p))
- return -EINVAL;
+ return -EFAULT;
if (tmp == WDIOS_ENABLECARD) {
booke_wdt_ping();
break;