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

* Re: [PATCH linux] ethtool: Remove redundant ret assignments
  2021-12-30  6:26 [PATCH linux] ethtool: Remove redundant ret assignments cgel.zte
@ 2021-12-30 13:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-12-30 13:30 UTC (permalink / raw)
  To: CGEL; +Cc: davem, kuba, sfr, netdev, linux-kernel, luo.penghao, zealci

Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Thu, 30 Dec 2021 06:26:44 +0000 you wrote:
> 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:
> 
> [...]

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



^ permalink raw reply	[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