aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2007-07-09 20:12:26 -0700
committerRoland Dreier <rolandd@cisco.com>2007-07-09 20:12:26 -0700
commit6abb6ea80b6564c00906aa0727cf59d2be780d82 (patch)
treedbfd28b4c8318706bea801cb72da294ed826e221
parentecc2f0060fa7ff2fc53864ee19e370e5ddd47d5e (diff)
downloadkernel_samsung_espresso10-6abb6ea80b6564c00906aa0727cf59d2be780d82.zip
kernel_samsung_espresso10-6abb6ea80b6564c00906aa0727cf59d2be780d82.tar.gz
kernel_samsung_espresso10-6abb6ea80b6564c00906aa0727cf59d2be780d82.tar.bz2
RDMA/cxgb3: Check return of kmalloc() in iwch_register_device()
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com> [ Also remove cast from void * return of kmalloc() as suggested by Jesper Juhl <jesper.juhl@gmail.com>. ] Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_provider.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
index e7c2c39..f0c7775 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
@@ -1163,9 +1163,10 @@ int iwch_register_device(struct iwch_dev *dev)
dev->ibdev.post_recv = iwch_post_receive;
- dev->ibdev.iwcm =
- (struct iw_cm_verbs *) kmalloc(sizeof(struct iw_cm_verbs),
- GFP_KERNEL);
+ dev->ibdev.iwcm = kmalloc(sizeof(struct iw_cm_verbs), GFP_KERNEL);
+ if (!dev->ibdev.iwcm)
+ return -ENOMEM;
+
dev->ibdev.iwcm->connect = iwch_connect;
dev->ibdev.iwcm->accept = iwch_accept_cr;
dev->ibdev.iwcm->reject = iwch_reject_cr;