]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ethtool: ethnl_set_linkmodes: remove redundant null check
authorGaurav Singh <gaurav1086@gmail.com>
Fri, 31 Jul 2020 04:58:44 +0000 (00:58 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Aug 2020 22:11:49 +0000 (15:11 -0700)
info cannot be NULL here since its being accessed earlier
in the function: nlmsg_parse(info->nlhdr...). Remove this
redundant NULL check.

Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethtool/linkmodes.c

index 317a93129551e9c9b209f77adecd83b7bf136b5c..7044a2853886d704b3015c640e7984d985c363f6 100644 (file)
@@ -421,8 +421,7 @@ int ethnl_set_linkmodes(struct sk_buff *skb, struct genl_info *info)
 
        ret = __ethtool_get_link_ksettings(dev, &ksettings);
        if (ret < 0) {
-               if (info)
-                       GENL_SET_ERR_MSG(info, "failed to retrieve link settings");
+               GENL_SET_ERR_MSG(info, "failed to retrieve link settings");
                goto out_ops;
        }