From: "John W. Linville" <linville@tuxdriver.com>
To: Yogesh Ashok Powar <yogesh.powar@gmail.com>
Cc: linux-wireless@vger.kernel.org,
Johannes Berg <johannes@sipsolutions.net>,
Yogesh Ashok Powar <yogeshp@marvell.com>,
Nishant Sarmukadam <nishants@marvell.com>
Subject: Re: [PATCH V2] mac80211: Fixing sparse warning at sta_info.c
Date: Mon, 19 Dec 2011 14:39:57 -0500 [thread overview]
Message-ID: <20111219193957.GC31462@tuxdriver.com> (raw)
In-Reply-To: <20111216061715.GA11190@dugs>
Applying: mac80211: Fixing sparse warning at sta_info.c
error: patch failed: net/mac80211/sta_info.c:974
error: net/mac80211/sta_info.c: patch does not apply
What tree did you use as a base for your patch?
On Fri, Dec 16, 2011 at 11:47:15AM +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_protected to fix the problem.
>
> V2:
> - Replacing rcu_dereference with rcu_dereference_protected
> as suggested by Johannes.
> - Adding mutex_lock/unlock to satisfy the condition at
> rcu_dereference_protected
>
> 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 | 9 +++++++--
> 1 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
> index c6ca9bd..e4307b7 100644
> --- a/net/mac80211/sta_info.c
> +++ b/net/mac80211/sta_info.c
> @@ -959,10 +959,13 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)
> * until the aggregation stop completes. Refer
> * http://thread.gmane.org/gmane.linux.kernel.wireless.general/81936
> */
> +
> + mutex_lock(&sta->ampdu_mlme.mtx);
> +
> for (i = 0; i < STA_TID_NUM; i++) {
> - if (!sta->ampdu_mlme.tid_tx[i])
> + tid_tx = rcu_dereference_protected_tid_tx(sta, 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 "
> @@ -974,6 +977,8 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)
> kfree_rcu(tid_tx, rcu_head);
> }
>
> + mutex_unlock(&sta->ampdu_mlme.mtx);
> +
> __sta_info_free(local, sta);
>
> return 0;
> --
> 1.7.5.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
next prev parent reply other threads:[~2011-12-19 19:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <82612>
2011-12-16 6:17 ` [PATCH V2] mac80211: Fixing sparse warning at sta_info.c Yogesh Ashok Powar
2011-12-19 19:39 ` John W. Linville [this message]
2011-12-19 20:13 ` John W. Linville
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111219193957.GC31462@tuxdriver.com \
--to=linville@tuxdriver.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=nishants@marvell.com \
--cc=yogesh.powar@gmail.com \
--cc=yogeshp@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).