2011-11-19 08:51:36

by Arik Nemtsov

[permalink] [raw]
Subject: [PATCH] mac80211: dereference RCU protected probe_resp pointer correctly

This fixes a sparse warning:

cfg.c:502:13: warning: incorrect type in assignment (different address spaces)
cfg.c:502:13: expected struct sk_buff *old
cfg.c:502:13: got struct sk_buff [noderef] <asn:4>*probe_resp

Reported-by: Johannes Berg <[email protected]>
Signed-off-by: Arik Nemtsov <[email protected]>
---
net/mac80211/cfg.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 1063a7e..abc8386 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -499,7 +499,7 @@ static int ieee80211_set_probe_resp(struct ieee80211_sub_if_data *sdata,
if (!resp || !resp_len)
return -EINVAL;

- old = sdata->u.ap.probe_resp;
+ old = rtnl_dereference(sdata->u.ap.probe_resp);

new = dev_alloc_skb(resp_len);
if (!new)
--
1.7.5.4