[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230228005217.105058-1-yang.lee@linux.alibaba.com>
Date: Tue, 28 Feb 2023 08:52:17 +0800
From: Yang Li <yang.lee@...ux.alibaba.com>
To: kuba@...nel.org
Cc: davem@...emloft.net, ralf@...ux-mips.org, edumazet@...gle.com,
pabeni@...hat.com, linux-hams@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Yang Li <yang.lee@...ux.alibaba.com>,
Abaci Robot <abaci@...ux.alibaba.com>
Subject: [PATCH net-next] net: rose: 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:
./net/rose/rose_route.c:619:2-10: WARNING: NULL check before dev_{put, hold} functions is not needed.
Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4239
Signed-off-by: Yang Li <yang.lee@...ux.alibaba.com>
---
net/rose/rose_route.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index fee772b4637c..58d0312c0119 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -615,8 +615,7 @@ struct net_device *rose_dev_first(void)
if (first == NULL || strncmp(dev->name, first->name, 3) < 0)
first = dev;
}
- if (first)
- dev_hold(first);
+ dev_hold(first);
rcu_read_unlock();
return first;
--
2.20.1.7.g153144c
Powered by blists - more mailing lists