Skip to content

Commit

Permalink
RDMA/bnxt_re: Fix static checker warning
Browse files Browse the repository at this point in the history
If there is ever any error while creating srq->umem, we return that
error, we don't store it in srq->umem, so any check of srq->umem for
IS_ERR is pointless.  Further, checking udata is unnecessary as
srq->umem is always either NULL or valid, without respect to udata.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
  • Loading branch information
dledford committed Jan 31, 2018
1 parent e7996a9 commit 589ccd8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/infiniband/hw/bnxt_re/ib_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ int bnxt_re_destroy_srq(struct ib_srq *ib_srq)
return rc;
}

if (srq->umem && !IS_ERR(srq->umem))
if (srq->umem)
ib_umem_release(srq->umem);
kfree(srq);
atomic_dec(&rdev->srq_count);
Expand Down Expand Up @@ -1430,11 +1430,8 @@ struct ib_srq *bnxt_re_create_srq(struct ib_pd *ib_pd,
return &srq->ib_srq;

fail:
if (udata && srq->umem && !IS_ERR(srq->umem)) {
if (srq->umem)
ib_umem_release(srq->umem);
srq->umem = NULL;
}

kfree(srq);
exit:
return ERR_PTR(rc);
Expand Down

0 comments on commit 589ccd8

Please sign in to comment.