aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaejoong Kim <[email protected]>2018-07-04 13:51:27 +0900
committerFelipe Balbi <[email protected]>2018-07-26 13:55:17 +0300
commit7a051e8de3010c2f5f52e0bf305ef96c1f1f19d5 (patch)
tree0c8484b7ebf7e4fbbed96ddbc4548c027562f8ec
parent211f658b7b40fd3355a0920481132645e24ffb16 (diff)
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]>
-rw-r--r--drivers/usb/gadget/function/f_mass_storage.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
index acecd13dcbd9..1b580eb3f78f 100644
--- a/drivers/usb/gadget/function/f_mass_storage.c
+++ b/drivers/usb/gadget/function/f_mass_storage.c
@@ -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: