public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nl80211: fix error pointer dereference in error handling
@ 2021-10-01 12:56 Dan Carpenter
  2021-10-01 16:11 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-10-01 12:56 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, kernel-janitors

The error handling calls kfree(params->acl) so if "params->acl" is an
error pointer that will lead to an Oops.

Fixes: 9e263e193af7 ("nl80211: don't put struct cfg80211_ap_settings on stack")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 net/wireless/nl80211.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 0b4f29d689d2..962fb169a5fb 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -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;
 		}
 	}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-01 16:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-01 12:56 [PATCH] nl80211: fix error pointer dereference in error handling Dan Carpenter
2021-10-01 16:11 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox