From: Vaibhav Shinde <v.bhav.shinde@gmail.com>
To: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: handling oz_ep_alloc() failure
Date: Fri, 27 Nov 2015 14:56:28 +0530 [thread overview]
Message-ID: <CAB5gotttiJgbdCYV7GxeHqLoH4iekM+QU99kKZqj=M86XEY_7A@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 753 bytes --]
I got a failure for allocation of order 3 pages from oz_ep_alloc() function
under low memory situation, so while checking the code came across this
call for oz_ep_alloc() which may not be handled gracefully.
So do we need to have the below check ?
$ git diff
diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c
index 565d873..867c3eb 100644
--- a/drivers/staging/ozwpan/ozhcd.c
+++ b/drivers/staging/ozwpan/ozhcd.c
@@ -722,6 +722,8 @@ void *oz_hcd_pd_arrived(void *hpd)
* use for out endpoint 0.
*/
ep = oz_ep_alloc(GFP_ATOMIC, 0);
+ if(!ep)
+ goto out;
spin_lock_bh(&ozhcd->hcd_lock);
if (ozhcd->conn_port >= 0) {
spin_unlock_bh(&ozhcd->hcd_lock);
[-- Attachment #2: Type: text/html, Size: 911 bytes --]
reply other threads:[~2015-11-27 9:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='CAB5gotttiJgbdCYV7GxeHqLoH4iekM+QU99kKZqj=M86XEY_7A@mail.gmail.com' \
--to=v.bhav.shinde@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-next@vger.kernel.org \
/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).