summaryrefslogtreecommitdiff
path: root/drivers/infiniband/core/lag.c
diff options
context:
space:
mode:
authorJules Irenge <jbi.octave@gmail.com>2024-05-01 01:47:45 +0300
committerLeon Romanovsky <leon@kernel.org>2024-05-05 15:12:35 +0300
commit48d80b484491f177c586874c480cf9ba3af82b4f (patch)
tree184a6b31886840a119ca55a715737aa2c5730d4f /drivers/infiniband/core/lag.c
parente4e40a87024c502dcca279504a4550e617eea037 (diff)
downloadlinux-48d80b484491f177c586874c480cf9ba3af82b4f.tar.xz
RDMA/core: Remove NULL check before dev_{put, hold}
Coccinelle reports a warning WARNING: NULL check before dev_{put, hold} functions is not needed The reason is the call netdev_{put, hold} of dev_{put,hold} will check NULL There is no need to check before using dev_{put, hold} Signed-off-by: Jules Irenge <jbi.octave@gmail.com> Link: https://lore.kernel.org/r/ZjF1Eedxwhn4JSkz@octinomon.home Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/infiniband/core/lag.c')
-rw-r--r--drivers/infiniband/core/lag.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/infiniband/core/lag.c b/drivers/infiniband/core/lag.c
index eca6e37c72ba..8fd80adfe833 100644
--- a/drivers/infiniband/core/lag.c
+++ b/drivers/infiniband/core/lag.c
@@ -93,8 +93,7 @@ static struct net_device *rdma_get_xmit_slave_udp(struct ib_device *device,
slave = netdev_get_xmit_slave(master, skb,
!!(device->lag_flags &
RDMA_LAG_FLAGS_HASH_ALL_SLAVES));
- if (slave)
- dev_hold(slave);
+ dev_hold(slave);
rcu_read_unlock();
kfree_skb(skb);
return slave;