summaryrefslogtreecommitdiff
path: root/net/ethtool
diff options
context:
space:
mode:
authorGaurav Singh <gaurav1086@gmail.com>2020-07-31 00:58:44 -0400
committerDavid S. Miller <davem@davemloft.net>2020-08-03 15:11:49 -0700
commit71fed0bc8665969f4681fc5772e5df42bfcc472e (patch)
treed2bd7c9b00cc75a214c4911ff791abc2ef385b72 /net/ethtool
parent9aba6c5b49254d5bee927d81593ed4429e91d4ae (diff)
downloadlwn-71fed0bc8665969f4681fc5772e5df42bfcc472e.tar.gz
lwn-71fed0bc8665969f4681fc5772e5df42bfcc472e.zip
ethtool: ethnl_set_linkmodes: remove redundant null check
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>
Diffstat (limited to 'net/ethtool')
-rw-r--r--net/ethtool/linkmodes.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ethtool/linkmodes.c b/net/ethtool/linkmodes.c
index 317a93129551..7044a2853886 100644
--- a/net/ethtool/linkmodes.c
+++ b/net/ethtool/linkmodes.c
@@ -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;
}