diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2007-07-09 23:12:26 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-07-09 23:12:26 -0400 |
commit | 6abb6ea80b6564c00906aa0727cf59d2be780d82 (patch) | |
tree | dbfd28b4c8318706bea801cb72da294ed826e221 /drivers/infiniband | |
parent | ecc2f0060fa7ff2fc53864ee19e370e5ddd47d5e (diff) |
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>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/cxgb3/iwch_provider.c | 7 |
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 e7c2c3948037..f0c777589374 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) | |||
1163 | dev->ibdev.post_recv = iwch_post_receive; | 1163 | dev->ibdev.post_recv = iwch_post_receive; |
1164 | 1164 | ||
1165 | 1165 | ||
1166 | dev->ibdev.iwcm = | 1166 | dev->ibdev.iwcm = kmalloc(sizeof(struct iw_cm_verbs), GFP_KERNEL); |
1167 | (struct iw_cm_verbs *) kmalloc(sizeof(struct iw_cm_verbs), | 1167 | if (!dev->ibdev.iwcm) |
1168 | GFP_KERNEL); | 1168 | return -ENOMEM; |
1169 | |||
1169 | dev->ibdev.iwcm->connect = iwch_connect; | 1170 | dev->ibdev.iwcm->connect = iwch_connect; |
1170 | dev->ibdev.iwcm->accept = iwch_accept_cr; | 1171 | dev->ibdev.iwcm->accept = iwch_accept_cr; |
1171 | dev->ibdev.iwcm->reject = iwch_reject_cr; | 1172 | dev->ibdev.iwcm->reject = iwch_reject_cr; |