Commit 7a051e8d authored by Jaejoong Kim's avatar Jaejoong Kim Committed by Felipe Balbi

usb: gadget: storage: Add error handling for no memory

fsg_common_set_num_buffers() may fail due to ENOMEM. So add
error handling for fail case.
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: default avatarJaejoong Kim <climbbb.kim@gmail.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 211f658b
...@@ -3308,7 +3308,9 @@ static ssize_t fsg_opts_num_buffers_store(struct config_item *item, ...@@ -3308,7 +3308,9 @@ static ssize_t fsg_opts_num_buffers_store(struct config_item *item,
if (ret) if (ret)
goto end; goto end;
fsg_common_set_num_buffers(opts->common, num); ret = fsg_common_set_num_buffers(opts->common, num);
if (ret)
goto end;
ret = len; ret = len;
end: end:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment