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: Alan Stern <[email protected]>
Acked-by: Michal Nazarewicz <[email protected]>
Signed-off-by: Jaejoong Kim <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
This commit is contained in:
Jaejoong Kim 2018-07-04 13:51:27 +09:00 • committed by Felipe Balbi
commit 7a051e8de3

View file

@ -3308,7 +3308,9 @@ static ssize_t fsg_opts_num_buffers_store(struct config_item *item,
if (ret)
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;
end: