forked from Minki/linux
Only a small fix for /sys entry
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJVSb+6AAoJEEhZKYFQ1nG7aRAH/AjHpptKlk06r1heeJxBcqhP cDRmAXEPet1r/elds8HDkKiMVwHA2CrHKaAO569qfXdrW7mYO0b1u4rjTpN762ky zHm+tYftI+5s0SXlSxrtVpexBsP+o26bk7g2VSdpR4VvN/iyuK1EAmP0t8C8uYtL vzjN9oBZB9nLESaFTBCHGZ4oTRjKbch1BAYOgCpDhKx3YzU8aVh6WwHarL96hz/i WGfBhLQqc7bT/VAB73odSgKYI2m2S5aWSjRbOruYM/GpjvO0shcAPJUTncMGE8d1 6/IbnPmYnGpIQMSxKPstk7Od2mCdF0IS5BzR1lElHihtzkLJ49bmWQNBmcMZ6Pg= =/AOj -----END PGP SIGNATURE----- Merge tag 'usb-ci-v4.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb into usb-linus Peter writes: Only a small fix for /sys entry
This commit is contained in:
commit
17aeca11ec
@ -88,9 +88,13 @@ static ssize_t ci_port_test_write(struct file *file, const char __user *ubuf,
|
||||
char buf[32];
|
||||
int ret;
|
||||
|
||||
if (copy_from_user(buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
|
||||
count = min_t(size_t, sizeof(buf) - 1, count);
|
||||
if (copy_from_user(buf, ubuf, count))
|
||||
return -EFAULT;
|
||||
|
||||
/* sscanf requires a zero terminated string */
|
||||
buf[count] = '\0';
|
||||
|
||||
if (sscanf(buf, "%u", &mode) != 1)
|
||||
return -EINVAL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user