mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 02:09:42 +00:00
RDMA/ocrdma: Fix error codes in ocrdma_create_srq()
If either of these allocations fail then we return ERR_PTR(0). That's
equivalent to NULL and results in a NULL pointer dereference in the
caller.
Fixes: fe2caefcdf
("RDMA/ocrdma: Add driver for Emulex OneConnect IBoE RDMA adapter")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
dd75cfa6d3
commit
f0c6e88288
1 changed files with 1 additions and 0 deletions
|
@ -1902,6 +1902,7 @@ struct ib_srq *ocrdma_create_srq(struct ib_pd *ibpd,
|
|||
goto err;
|
||||
|
||||
if (udata == NULL) {
|
||||
status = -ENOMEM;
|
||||
srq->rqe_wr_id_tbl = kzalloc(sizeof(u64) * srq->rq.max_cnt,
|
||||
GFP_KERNEL);
|
||||
if (srq->rqe_wr_id_tbl == NULL)
|
||||
|
|
Loading…
Reference in a new issue