booke/wdt: some ioctls do not return values properly
PATCH v2 1/1 booke/wdt: some ioctls do not return values properly
Fix some booke wdt ioctls return value error.
Signed-off-by Tiejun Chen <[email protected]>
--- drivers/watchdog/booke_wdt.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/watchdog/booke_wdt.c +3 -4
@@ -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 ;
Signature · 1 line
1.5.6
Quoted 3 lines · Tiejun Chen
Fix some booke wdt ioctls return value error.
Signed-off-by Tiejun Chen <[email protected]>
It's not the greatest patch description, but it'll do.
Acked-by Timur Tabi <[email protected]>
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
Kumar Gala
AppliedQuoted 6 lines · Tiejun Chen
Fix some booke wdt ioctls return value error.
Signed-off-by Tiejun Chen <[email protected]>---
drivers/watchdog/booke_wdt.c| 7 +++----1 files changed, 3 insertions(+), 4 deletions(-)
applied to merge
- k