Fix compile warnings in musb debug code; it should have been checking
the value of copy_from_user().
Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
/* 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) {
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 == '-') {