linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Fixing sparse warning at sta_info.c
@ 2011-12-15  5:13 Yogesh Ashok Powar
  2011-12-15  8:23 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Yogesh Ashok Powar @ 2011-12-15  5:13 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Nishant Sarmukadam, Johannes Berg

The commit 42624d4913a00219a8fdbb4bafd634d1d843be85
created following sparse warning
>net/mac80211/sta_info.c:965:24: warning: incorrect type in assignment (different address spaces)
>net/mac80211/sta_info.c:965:24:    expected struct tid_ampdu_tx *tid_tx
>net/mac80211/sta_info.c:965:24:    got struct tid_ampdu_tx [noderef] <asn:4>*<noident>

Making use of rcu_dereference to fix the problem.

Cc: Nishant Sarmukadam <nishants@marvell.com>
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
---
 net/mac80211/sta_info.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index c6ca9bd..c2d4810 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -960,9 +960,9 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)
 	 * http://thread.gmane.org/gmane.linux.kernel.wireless.general/81936
 	 */
 	for (i = 0; i < STA_TID_NUM; i++) {
-		if (!sta->ampdu_mlme.tid_tx[i])
+		tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[i]);
+		if (!tid_tx)
 			continue;
-		tid_tx = sta->ampdu_mlme.tid_tx[i];
 		if (skb_queue_len(&tid_tx->pending)) {
 #ifdef CONFIG_MAC80211_HT_DEBUG
 			wiphy_debug(local->hw.wiphy, "TX A-MPDU  purging %d "
-- 
1.5.4.1


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

* Re: [PATCH] mac80211: Fixing sparse warning at sta_info.c
  2011-12-15  5:13 [PATCH] mac80211: Fixing sparse warning at sta_info.c Yogesh Ashok Powar
@ 2011-12-15  8:23 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2011-12-15  8:23 UTC (permalink / raw)
  To: Yogesh Ashok Powar; +Cc: John W. Linville, linux-wireless, Nishant Sarmukadam

On Thu, 2011-12-15 at 10:43 +0530, Yogesh Ashok Powar wrote:
> The commit 42624d4913a00219a8fdbb4bafd634d1d843be85
> created following sparse warning
> >net/mac80211/sta_info.c:965:24: warning: incorrect type in assignment (different address spaces)
> >net/mac80211/sta_info.c:965:24:    expected struct tid_ampdu_tx *tid_tx
> >net/mac80211/sta_info.c:965:24:    got struct tid_ampdu_tx [noderef] <asn:4>*<noident>
> 
> Making use of rcu_dereference to fix the problem.

That doesn't fix any problem. It trades the compiler warning for a
runtime warning, so NACK.

You will need something like rcu_dereference_protected() here (although
it's not actually protected, but there's also no need to)

johannes


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

end of thread, other threads:[~2011-12-15  8:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-15  5:13 [PATCH] mac80211: Fixing sparse warning at sta_info.c Yogesh Ashok Powar
2011-12-15  8:23 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).