Commit 52405e0d authored by Dirk Behme's avatar Dirk Behme Committed by Tony Lindgren

musb_hdrc: Fix compile warnings in musb debug code

Fix compile warnings in musb debug code; it should have been checking
the value of copy_from_user().
Signed-off-by: default avatarDirk Behme <dirk.behme@gmail.com>
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
parent 0855214a
......@@ -648,7 +648,9 @@ static int musb_proc_write(struct file *file, const char __user *buffer,
/* MOD_INC_USE_COUNT; */
copy_from_user(&cmd, buffer, 1);
if (unlikely(copy_from_user(&cmd, buffer, 1)))
return -EFAULT;
switch (cmd) {
case 'C':
if (pBase) {
......@@ -722,7 +724,8 @@ static int musb_proc_write(struct file *file, const char __user *buffer,
int i = 0, level = 0, sign = 1;
int len = min(count - 1, (unsigned long)8);
copy_from_user(&digits, &buffer[1], len);
if (copy_from_user(&digits, &buffer[1], len))
return -EFAULT;
/* optional sign */
if (*p == '-') {
......
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