From cb2f51a4eef87d1f5464324073702487722752f6 Mon Sep 17 00:00:00 2001 From: Tiejun Chen Date: Tue, 7 Aug 2012 09:59:40 +0800 Subject: [PATCH] --- yaml --- r: 322267 b: refs/heads/master c: 127c6e731106a2071ee4a6c5a34c471cd3e719f0 h: refs/heads/master i: 322265: 2541bd9b845050eddbe5393de99a834b861ae3e6 322263: 1a5fd0adef34153b450a9a91075fd3f1013d11d6 v: v3 --- [refs] | 2 +- trunk/drivers/watchdog/booke_wdt.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 1dcb06011b55..698772835e85 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 09a3017a585eb8567a7de15b426bb1dfb548bf0f +refs/heads/master: 127c6e731106a2071ee4a6c5a34c471cd3e719f0 diff --git a/trunk/drivers/watchdog/booke_wdt.c b/trunk/drivers/watchdog/booke_wdt.c index 3fe82d0e8caa..5b06d31ab6a9 100644 --- a/trunk/drivers/watchdog/booke_wdt.c +++ b/trunk/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;