diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-06 22:07:44 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-06 22:07:44 -0700 |
commit | dc502142b65b9e31eb90ab4344b3acadb2698317 (patch) | |
tree | 59be531fcce876dbe0bbc1ddf5a84fc9b3ee8a27 /drivers | |
parent | 90880b532a7ebd13a052d6c410807b33809a3efb (diff) | |
parent | b7310105ab2cd9168fe50564d8b9d248325a326e (diff) |
Merge branch 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull user access str* updates from Al Viro:
"uaccess str...() dead code removal"
* 'uaccess.strlen' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
s390 keyboard.c: don't open-code strndup_user()
mips: get rid of unused __strnlen_user()
get rid of unused __strncpy_from_user() instances
kill strlen_user()
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/char/keyboard.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c index ba0e4f93503d..186d05e4c767 100644 --- a/drivers/s390/char/keyboard.c +++ b/drivers/s390/char/keyboard.c @@ -433,12 +433,7 @@ do_kdgkb_ioctl(struct kbd_data *kbd, struct kbsentry __user *u_kbs, case KDSKBSENT: if (!perm) return -EPERM; - len = strnlen_user(u_kbs->kb_string, sizeof(u_kbs->kb_string)); - if (!len) - return -EFAULT; - if (len > sizeof(u_kbs->kb_string)) - return -EINVAL; - p = memdup_user_nul(u_kbs->kb_string, len); + p = strndup_user(u_kbs->kb_string, sizeof(u_kbs->kb_string)); if (IS_ERR(p)) return PTR_ERR(p); kfree(kbd->func_table[kb_func]); |