Skip to content

Commit 6735041

Browse files
Yang Lijgunthorpe
authored andcommitted
RDMA/cma: Remove NULL check before dev_{put, hold}
The call netdev_{put, hold} of dev_{put, hold} will check NULL, so there is no need to check before using dev_{put, hold}, remove it to silence the warning: ./drivers/infiniband/core/cma.c:4812:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed. Link: https://lore.kernel.org/r/[email protected] Reported-by: Abaci Robot <[email protected]> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5521 Signed-off-by: Yang Li <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 350b6dd commit 6735041

File tree

1 file changed

+1
-2
lines changed
  • drivers/infiniband/core

1 file changed

+1
-2
lines changed

drivers/infiniband/core/cma.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4805,8 +4805,7 @@ static void cma_make_mc_event(int status, struct rdma_id_private *id_priv,
48054805
event->param.ud.qkey = id_priv->qkey;
48064806

48074807
out:
4808-
if (ndev)
4809-
dev_put(ndev);
4808+
dev_put(ndev);
48104809
}
48114810

48124811
static int cma_ib_mc_handler(int status, struct ib_sa_multicast *multicast)

0 commit comments

Comments
 (0)