wifi: nl80211: remove redundant err variable
authorJinpeng Cui <cui.jinpeng2@zte.com.cn>
Mon, 29 Aug 2022 11:29:53 +0000 (11:29 +0000)
committerJohannes Berg <johannes.berg@intel.com>
Sat, 3 Sep 2022 15:01:09 +0000 (17:01 +0200)
Return value from rdev_set_mcast_rate() directly instead of
taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c

index dad88d231d56037ff8a956a8d342fe8cbfaaf136..4f5e5b763a15d50bedfb91820d1fe1c996ed6783 100644 (file)
@@ -11279,7 +11279,6 @@ static int nl80211_set_mcast_rate(struct sk_buff *skb, struct genl_info *info)
        struct net_device *dev = info->user_ptr[1];
        int mcast_rate[NUM_NL80211_BANDS];
        u32 nla_rate;
-       int err;
 
        if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC &&
            dev->ieee80211_ptr->iftype != NL80211_IFTYPE_MESH_POINT &&
@@ -11298,9 +11297,7 @@ static int nl80211_set_mcast_rate(struct sk_buff *skb, struct genl_info *info)
        if (!nl80211_parse_mcast_rate(rdev, mcast_rate, nla_rate))
                return -EINVAL;
 
-       err = rdev_set_mcast_rate(rdev, dev, mcast_rate);
-
-       return err;
+       return rdev_set_mcast_rate(rdev, dev, mcast_rate);
 }
 
 static struct sk_buff *