diff mbox series

[linux] ethtool: Remove redundant ret assignments

Message ID 20211230062644.586079-1-luo.penghao@zte.com.cn (mailing list archive)
State Accepted
Commit c09f103e89f4554b17c68c3a0a50140fc9133352
Delegated to: Netdev Maintainers
Headers show
Series [linux] ethtool: Remove redundant ret assignments | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 2 this patch: 2
netdev/cc_maintainers warning 1 maintainers not CCed: hkallweit1@gmail.com
netdev/build_clang success Errors and warnings before: 20 this patch: 20
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

CGEL Dec. 30, 2021, 6:26 a.m. UTC
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(-)

Comments

patchwork-bot+netdevbpf@kernel.org Dec. 30, 2021, 1:30 p.m. UTC | #1
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!
diff mbox series

Patch

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;