Commit ea20670f authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] simplify wdt285 copying.

copy_to_user already does the relevant checking.
parent 65da4ecc
...@@ -136,11 +136,9 @@ static int watchdog_ioctl(struct inode *inode, struct file *file, ...@@ -136,11 +136,9 @@ static int watchdog_ioctl(struct inode *inode, struct file *file,
default: default:
return -ENOTTY; return -ENOTTY;
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
i = verify_area(VERIFY_WRITE, (void*) arg, sizeof(struct watchdog_info)); if(copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)))
if (i) return -EFAULT;
return i; return 0;
else
return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident));
case WDIOC_GETSTATUS: case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS: case WDIOC_GETBOOTSTATUS:
return put_user(0,(int *)arg); return put_user(0,(int *)arg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment