diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-06-05 13:04:13 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-06-05 22:10:02 +0200 |
commit | 178f67b1288b6952117fdc4e5ffbd4c4bd4e4a7f (patch) | |
tree | 1ec860fb6ae58be98d009b9a5975396b120b6b24 /net | |
parent | net/xdp: use shift instead of 64 bit division (diff) | |
download | linux-178f67b1288b6952117fdc4e5ffbd4c4bd4e4a7f.tar.xz linux-178f67b1288b6952117fdc4e5ffbd4c4bd4e4a7f.zip |
ethtool: linkinfo: remove an unnecessary NULL check
This code generates a Smatch warning:
net/ethtool/linkinfo.c:143 ethnl_set_linkinfo()
warn: variable dereferenced before check 'info' (see line 119)
Fortunately, the "info" pointer is never NULL so the check can be
removed.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ethtool/linkinfo.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ethtool/linkinfo.c b/net/ethtool/linkinfo.c index 677068deb68c..5eaf173eaaca 100644 --- a/net/ethtool/linkinfo.c +++ b/net/ethtool/linkinfo.c @@ -140,8 +140,7 @@ int ethnl_set_linkinfo(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; } lsettings = &ksettings.base; |