lkml.org 
[lkml]   [2007]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[-mm Patch] INFINIBAND: check the return value of kmalloc

Don't forget to check the return value of kmalloc().

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

Index: linux-2.6.22-rc6-mm1/drivers/infiniband/hw/cxgb3/iwch_provider.c
===================================================================
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c 2007-06-29 13:18:20.000000000 +0800
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c 2007-07-04 23:17:02.000000000 +0800
@@ -1166,6 +1166,10 @@
dev->ibdev.iwcm =
(struct iw_cm_verbs *) kmalloc(sizeof(struct iw_cm_verbs),
GFP_KERNEL);
+ if (!dev->ibdev.iwcm) {
+ ret = -1;
+ goto bail1;
+ }
dev->ibdev.iwcm->connect = iwch_connect;
dev->ibdev.iwcm->accept = iwch_accept_cr;
dev->ibdev.iwcm->reject = iwch_reject_cr;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-07-04 18:37    [W:0.056 / U:1.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site