From: Jaejoong Kim <climbbb.kim@gmail.com>
To: Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Krzysztof Opasiak <k.opasiak@samsung.com>,
Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org
Subject: [2/3] usb: gadget: storage: Add error handling for no memory
Date: Thu, 14 Jun 2018 18:23:58 +0900 [thread overview]
Message-ID: <1528968239-2447-3-git-send-email-climbbb.kim@gmail.com> (raw)
fsg_common_set_num_buffers() may fail due to ENOMEM. So add
error handling for fail case.
Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
---
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 83eeafe..b6e2930 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:
next reply other threads:[~2018-06-14 9:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-14 9:23 Jaejoong Kim [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-06-14 14:50 [2/3] usb: gadget: storage: Add error handling for no memory Alan Stern
2018-06-26 8:37 Michał Nazarewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1528968239-2447-3-git-send-email-climbbb.kim@gmail.com \
--to=climbbb.kim@gmail.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=k.opasiak@samsung.com \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).