aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/bnxt_re
diff options
context:
space:
mode:
authorDoug Ledford <dledford@redhat.com>2018-01-31 11:13:07 -0500
committerDoug Ledford <dledford@redhat.com>2018-01-31 16:19:50 -0500
commit589ccd8b0404281ebc84fe9a9ae51ddbc6d1a8c1 (patch)
treeb191b341f430df506d25e4daf3f879202395cb14 /drivers/infiniband/hw/bnxt_re
parentMerge tag v4.15 of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git (diff)
downloadlinux-dev-589ccd8b0404281ebc84fe9a9ae51ddbc6d1a8c1.tar.xz
linux-dev-589ccd8b0404281ebc84fe9a9ae51ddbc6d1a8c1.zip
RDMA/bnxt_re: Fix static checker warning
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>
Diffstat (limited to 'drivers/infiniband/hw/bnxt_re')
-rw-r--r--drivers/infiniband/hw/bnxt_re/ib_verbs.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index 9b8fa77b8831..ae9e9ff54826 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -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);
@@ -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);