linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [V2,1/2] usb: gadget: storage: Add error handling for no memory
@ 2018-07-04  4:51 Jaejoong Kim
  0 siblings, 0 replies; only message in thread
From: Jaejoong Kim @ 2018-07-04  4:51 UTC (permalink / raw)
  To: Michał Nazarewicz, Alan Stern, Felipe Balbi, Greg KH,
	Krzysztof Opasiak
  Cc: USB list

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>
---
Changes in V2:
  Add Acked-by

 drivers/usb/gadget/function/f_mass_storage.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
index acecd13..1b580eb 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:

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-07-04  4:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-04  4:51 [V2,1/2] usb: gadget: storage: Add error handling for no memory Jaejoong Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).