linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* handling oz_ep_alloc() failure
@ 2015-11-27  9:26 Vaibhav Shinde
  0 siblings, 0 replies; only message in thread
From: Vaibhav Shinde @ 2015-11-27  9:26 UTC (permalink / raw)
  To: linux-next, linux-kernel, linux-mm

[-- 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 --]

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

only message in thread, other threads:[~2015-11-27  9:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-27  9:26 handling oz_ep_alloc() failure Vaibhav Shinde

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).