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> Signed-off-by: hongrongxuan <hongrongxuan@huawei.com>
This commit is contained in:
parent
cf7cbebb2b
commit
97e29f899f
|
@ -140,7 +140,6 @@ int ethnl_set_linkinfo(struct sk_buff *skb, struct genl_info *info)
|
||||||
|
|
||||||
ret = __ethtool_get_link_ksettings(dev, &ksettings);
|
ret = __ethtool_get_link_ksettings(dev, &ksettings);
|
||||||
if (ret < 0) {
|
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;
|
goto out_ops;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue