diff mbox

cfg80211: Use correct GFP_ mask in cfg80211_del_sta_sinfo()

Message ID 20180516084836.GB23043@mwanda (mailing list archive)
State Not Applicable
Delegated to: Johannes Berg
Headers show

Commit Message

Dan Carpenter May 16, 2018, 8:48 a.m. UTC
Smatch complains that we should use the passed in "gfp" instead of hard
coding GFP_KERNEL.  I looked at some of the callers and this would
probably be a bug for rtw_cfg80211_indicate_sta_disassoc() which uses
GFP_ATOMIC and a NULL "sinfo".

Fixes: 52539ca89f36 ("cfg80211: Expose TXQ stats and parameters to userspace")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Toke Høiland-Jørgensen May 16, 2018, 9:25 a.m. UTC | #1
Dan Carpenter <dan.carpenter@oracle.com> writes:

> Smatch complains that we should use the passed in "gfp" instead of hard
> coding GFP_KERNEL.  I looked at some of the callers and this would
> probably be a bug for rtw_cfg80211_indicate_sta_disassoc() which uses
> GFP_ATOMIC and a NULL "sinfo".
>
> Fixes: 52539ca89f36 ("cfg80211: Expose TXQ stats and parameters to userspace")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Ah, right, didn't notice that that was supposed to be a gfp value.
Thanks for the fix :)

Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>


-Toke
diff mbox

Patch

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index afbe5105bf7f..3eb645b81777 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -14644,7 +14644,7 @@  void cfg80211_del_sta_sinfo(struct net_device *dev, const u8 *mac_addr,
 	struct station_info *empty_sinfo = NULL;
 
 	if (!sinfo) {
-		empty_sinfo = kzalloc(sizeof(*empty_sinfo), GFP_KERNEL);
+		empty_sinfo = kzalloc(sizeof(*empty_sinfo), gfp);
 		if (!empty_sinfo)
 			return;
 		sinfo = empty_sinfo;