Commit 6abb6ea8 authored by WANG Cong's avatar WANG Cong Committed by Roland Dreier

RDMA/cxgb3: Check return of kmalloc() in iwch_register_device()

Signed-off-by: default avatarWANG 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: default avatarRoland Dreier <rolandd@cisco.com>
parent ecc2f006
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment