Message ID | 1361382069-31729-2-git-send-email-greearb@candelatech.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On Wed, Feb 20, 2013 at 09:41:09AM -0800, greearb@candelatech.com wrote: > From: Ben Greear <greearb@candelatech.com> > > The monitor_work and beacon_connection_loss_work items were > not being canceled on disassociation (and not on deletion > either). This leads to work-items trying to run after memory > has been deleted. [skip] > > + /* Make sure some work items will not run after this. > + * Have to do this outside the ifmgd->mtx lock. > + */ > + cancel_work_sync(&ifmgd->monitor_work); > + cancel_work_sync(&ifmgd->beacon_connection_loss_work); Other works should be canceled as well. Ben, could you repost this patch with proper comment? Stanislaw -- 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
On 02/26/2013 08:05 AM, Stanislaw Gruszka wrote: > On Wed, Feb 20, 2013 at 09:41:09AM -0800, greearb@candelatech.com wrote: >> From: Ben Greear <greearb@candelatech.com> >> >> The monitor_work and beacon_connection_loss_work items were >> not being canceled on disassociation (and not on deletion >> either). This leads to work-items trying to run after memory >> has been deleted. > [skip] >> >> + /* Make sure some work items will not run after this. >> + * Have to do this outside the ifmgd->mtx lock. >> + */ >> + cancel_work_sync(&ifmgd->monitor_work); >> + cancel_work_sync(&ifmgd->beacon_connection_loss_work); > > Other works should be canceled as well. Ben, could you repost > this patch with proper comment? At least in 3.7 kernel, this seems to be all that is needed. I don't have much time to work on this now... Thanks, Ben > > Stanislaw >
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 4001d1c..f46607a 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -3651,6 +3651,12 @@ void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata) { struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; + /* Make sure some work items will not run after this. + * Have to do this outside the ifmgd->mtx lock. + */ + cancel_work_sync(&ifmgd->monitor_work); + cancel_work_sync(&ifmgd->beacon_connection_loss_work); + mutex_lock(&ifmgd->mtx); if (ifmgd->assoc_data) ieee80211_destroy_assoc_data(sdata, false);