We should return -ENOMEM if the allocation fails. (The current code
returns succees).
Fixes: 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-By: Devesh Sharma <devesh.sharma@broadcom.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
srq->swq = kcalloc(srq->hwq.max_elements, sizeof(*srq->swq),
GFP_KERNEL);
- if (!srq->swq)
+ if (!srq->swq) {
+ rc = -ENOMEM;
goto fail;
+ }
RCFW_CMD_PREP(req, CREATE_SRQ, cmd_flags);