summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Irenge <jbi.octave@gmail.com>2024-05-01 00:47:33 +0100
committerLeon Romanovsky <leon@kernel.org>2024-05-02 17:46:38 +0300
commite4e40a87024c502dcca279504a4550e617eea037 (patch)
tree9f0a36d9711244e633df5f68a6ce527a213574c5
parent82e966130ddd67539ab904f2038e7bf5d4a66247 (diff)
RDMA/ipoib: 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/ZjGDFatHRMI6Eg7M@octinomon.home Signed-off-by: Leon Romanovsky <leon@kernel.org>
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 6f2a688fccbf..4abec0124ea3 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -329,8 +329,7 @@ static struct net_device *ipoib_get_master_net_dev(struct net_device *dev)
rcu_read_lock();
master = netdev_master_upper_dev_get_rcu(dev);
- if (master)
- dev_hold(master);
+ dev_hold(master);
rcu_read_unlock();
if (master)