mirror of https://gitee.com/openkylin/linux.git
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 <stern@rowland.harvard.edu> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
parent
211f658b7b
commit
7a051e8de3
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue