[PATCH linux] ethtool: Remove redundant ret assignments

Subsystems: networking [ethtool], networking [general], the rest

STALE1743d

2 messages, 2 authors, 2021-12-30 · open the first message on its own page

[PATCH linux] ethtool: Remove redundant ret assignments

From: <hidden>
Date: 2021-12-30 06:26:59

From: luo penghao <redacted>

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 <redacted>
Signed-off-by: luo penghao <redacted>
---
 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

Re: [PATCH linux] ethtool: Remove redundant ret assignments

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-12-30 13:30:30

Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller [off-list ref]:

On Thu, 30 Dec 2021 06:26:44 +0000 you wrote:
From: luo penghao <redacted>

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

The clang_analyzer complains as follows:

net/ethtool/netlink.c:

[...]
Here is the summary with links:
  - [linux] ethtool: Remove redundant ret assignments
    https://git.kernel.org/netdev/net-next/c/c09f103e89f4

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help