Skip to content

Commit

Permalink
providers/bnxt_re: Fix bnxt_re_alloc_queue_ptr error flow
Browse files Browse the repository at this point in the history
[ Upstream commit accaf33 ]

Make sure to free the "qp->jsqq" pointer in the right place.

Fixes: f92837e ("bnxt_re/lib: consolidate hwque and swque in common structure")
Signed-off-by: Kamal Heib <kheib@redhat.com>
Signed-off-by: Nicolas Morey <nmorey@suse.com>
  • Loading branch information
Kamalheib authored and nmorey committed Sep 28, 2023
1 parent fb2a13f commit 3292152
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions providers/bnxt_re/verbs.c
Expand Up @@ -849,10 +849,9 @@ static int bnxt_re_alloc_queue_ptr(struct bnxt_re_qp *qp,

if (!attr->srq) {
qp->jrqq = calloc(1, sizeof(struct bnxt_re_joint_queue));
if (!qp->jrqq) {
free(qp->jsqq);
if (!qp->jrqq)
goto fail;
}

qp->jrqq->hwque = calloc(1, sizeof(struct bnxt_re_queue));
if (!qp->jrqq->hwque)
goto fail;
Expand Down

0 comments on commit 3292152

Please sign in to comment.