mirror of
https://github.com/torvalds/linux.git
synced 2024-11-14 16:12:02 +00:00
usb: gadget: configfs: Fix set but not used variable warning
Fix a -Wunused-but-set-variable warning in gadget_string_s_store()
Fixes: 15a7cf8caa
("usb: gadget: configfs: Support arbitrary string descriptors")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Link: https://lore.kernel.org/r/20230209094359.1549629-1-dan.scally@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
88e054e8df
commit
8488a831e0
@ -821,13 +821,11 @@ static ssize_t gadget_string_s_store(struct config_item *item, const char *page,
|
||||
{
|
||||
struct gadget_string *string = to_gadget_string(item);
|
||||
int size = min(sizeof(string->string), len + 1);
|
||||
int ret;
|
||||
|
||||
if (len > USB_MAX_STRING_LEN)
|
||||
return -EINVAL;
|
||||
|
||||
ret = strscpy(string->string, page, size);
|
||||
return len;
|
||||
return strscpy(string->string, page, size);
|
||||
}
|
||||
CONFIGFS_ATTR(gadget_string_, s);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user