Blob Blame History Raw
From: Gaurav Singh <gaurav1086@gmail.com>
Date: Fri, 31 Jul 2020 00:58:44 -0400
Subject: ethtool: ethnl_set_linkmodes: remove redundant null check
Patch-mainline: v5.9-rc1
Git-commit: 71fed0bc8665969f4681fc5772e5df42bfcc472e
References: bsc#1176447

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>
Acked-by: Michal Kubecek <mkubecek@suse.cz>

---
 net/ethtool/linkmodes.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/net/ethtool/linkmodes.c
+++ b/net/ethtool/linkmodes.c
@@ -353,8 +353,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;
 	}