]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ethtool: Remove redundant ret assignments
authorluo penghao <luo.penghao@zte.com.cn>
Thu, 30 Dec 2021 06:26:44 +0000 (06:26 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Dec 2021 13:29:14 +0000 (13:29 +0000)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethtool/netlink.c

index f09c62302a9a8942b3210a0496319cd5bcac1b0b..ea23659fab28c734d1a8c11d857b3795f104beec 100644 (file)
@@ -638,7 +638,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;