public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux] ethtool: Remove redundant ret assignments
@ 2021-12-30  6:26 cgel.zte
  2021-12-30 13:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2021-12-30  6:26 UTC (permalink / raw)
  To: David S . Miller
  Cc: Jakub Kicinski, Stephen Rothwell, netdev, linux-kernel,
	luo penghao, Zeal Robot

From: luo penghao <luo.penghao@zte.com.cn>

The assignment here will be overwritten, so it should be deleted

The clang_analyzer complains as follows:

net/ethtool/netlink.c:

Value stored to 'ret' is never read

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: luo penghao <luo.penghao@zte.com.cn>
---
 net/ethtool/netlink.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c
index b3729bd..5e23462 100644
--- a/net/ethtool/netlink.c
+++ b/net/ethtool/netlink.c
@@ -633,7 +633,6 @@ static void ethnl_default_notify(struct net_device *dev, unsigned int cmd,
 	if (ret < 0)
 		goto err_cleanup;
 	reply_len = ret + ethnl_reply_header_size();
-	ret = -ENOMEM;
 	skb = genlmsg_new(reply_len, GFP_KERNEL);
 	if (!skb)
 		goto err_cleanup;
-- 
2.15.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-30 13:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-30  6:26 [PATCH linux] ethtool: Remove redundant ret assignments cgel.zte
2021-12-30 13:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox