cxgb4: Fix error codes in c4iw_create_cq()
If one of these kmalloc() calls fails then we return ERR_PTR(0) which is
NULL. It results in a NULL dereference in the callers.
Fixes: cfdda9d764
("RDMA/cxgb4: Add driver for Chelsio T4 RNIC")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
6031e079aa
commit
6ebedacbb4
|
@ -963,6 +963,7 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev,
|
||||||
goto err3;
|
goto err3;
|
||||||
|
|
||||||
if (ucontext) {
|
if (ucontext) {
|
||||||
|
ret = -ENOMEM;
|
||||||
mm = kmalloc(sizeof *mm, GFP_KERNEL);
|
mm = kmalloc(sizeof *mm, GFP_KERNEL);
|
||||||
if (!mm)
|
if (!mm)
|
||||||
goto err4;
|
goto err4;
|
||||||
|
|
Loading…
Reference in New Issue