[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZjGDFatHRMI6Eg7M@octinomon.home>
Date: Wed, 1 May 2024 00:47:33 +0100
From: Jules Irenge <jbi.octave@...il.com>
To: leon@...nel.org
Cc: jgg@...pe.ca, linux-kernel@...r.kernel.org, linux-rdma@...r.kernel.org,
lishifeng@...gfor.com.cn, gustavoars@...nel.org
Subject: [PATCH] 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@...il.com>
---
drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 +--
1 file changed, 1 insertion(+), 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)
--
2.43.2
Powered by blists - more mailing lists