]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
nl80211: don't kfree() ERR_PTR() value
authorJohannes Berg <johannes.berg@intel.com>
Mon, 27 Sep 2021 11:44:03 +0000 (13:44 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 27 Sep 2021 13:32:54 +0000 (15:32 +0200)
When parse_acl_data() fails, we get an ERR_PTR() value and
then "goto out;", in this case we'd attempt to kfree() it.
Fix that.

Fixes: 9e263e193af7 ("nl80211: don't put struct cfg80211_ap_settings on stack")
Link: https://lore.kernel.org/r/20210927134402.86c5ae06c952.Ic51e234d998b9045665e5ff8b6db7e29f25d70c0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c

index d7c03f6145f00248465397357ec476764b712a4c..0f728de36f3305dc57c0081799d3300492ce91db 100644 (file)
@@ -5507,6 +5507,7 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
                params->acl = parse_acl_data(&rdev->wiphy, info);
                if (IS_ERR(params->acl)) {
                        err = PTR_ERR(params->acl);
+                       params->acl = NULL;
                        goto out;
                }
        }