mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
USB: gadget: u_ether: Fix a configfs return code
If the string is invalid, this should return -EINVAL instead of 0.
Fixes: 73517cf49b ("usb: gadget: add RNDIS configfs options for class/subclass/protocol")
Cc: stable <stable@vger.kernel.org>
Acked-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YCqZ3P53yyIg5cn7@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1edbff9c80
commit
650bf52208
@@ -182,12 +182,11 @@ out: \
|
||||
size_t len) \
|
||||
{ \
|
||||
struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item); \
|
||||
int ret; \
|
||||
int ret = -EINVAL; \
|
||||
u8 val; \
|
||||
\
|
||||
mutex_lock(&opts->lock); \
|
||||
ret = sscanf(page, "%02hhx", &val); \
|
||||
if (ret > 0) { \
|
||||
if (sscanf(page, "%02hhx", &val) > 0) { \
|
||||
opts->_n_ = val; \
|
||||
ret = len; \
|
||||
} \
|
||||
|
||||
Reference in New Issue
Block a user