public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [-mm Patch] INFINIBAND: check the return value of kmalloc
@ 2007-07-04 16:37 WANG Cong
  2007-07-05  0:00 ` Jesper Juhl
  0 siblings, 1 reply; 6+ messages in thread
From: WANG Cong @ 2007-07-04 16:37 UTC (permalink / raw)
  To: rolandd, mshefty, halr; +Cc: Andrew Morton, LKML


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;

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-07-09 19:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-04 16:37 [-mm Patch] INFINIBAND: check the return value of kmalloc WANG Cong
2007-07-05  0:00 ` Jesper Juhl
2007-07-05 21:42   ` Roland Dreier
2007-07-05 22:26     ` Jesper Juhl
2007-07-06  3:03     ` WANG Cong
2007-07-09 19:57     ` Steve Wise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox