iwlwifi: mvm: fix ROC reference accounting
authorEliad Peller <eliad@wizery.com>
Sun, 19 Apr 2015 08:41:04 +0000 (11:41 +0300)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 26 May 2015 16:21:07 +0000 (19:21 +0300)
commitc779273b37bec14c33feeab11c4d457a24bc64e0
tree016291fb1fdeff9d89742d967e7b103059fc4688
parenta61408e9a48e7634984408e334b125a72726440e
iwlwifi: mvm: fix ROC reference accounting

commit b112889c5af8124 ("iwlwifi: mvm: add Aux ROC request/response flow")
added aux ROC flow in addition to the existing ROC flow. While doing
it, it moved the ROC reference release to a common work item, which
is being called for both the ROC and aux ROC flows.

This resulted in invalid reference accounting, as no reference was
taken in case of aux ROC, while a reference was released on completion.

Fix it by adding a reference for the aux ROC as well, and release
only the relevant references on completion (according to the set bits).

While at it, convert cancel_work_sync() to flush_work(), in order
to make sure the references are being cleaned properly.

Fixes: b112889c5af8 ("iwlwifi: mvm: add Aux ROC request/response flow")
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/debugfs.c
drivers/net/wireless/iwlwifi/mvm/mac80211.c
drivers/net/wireless/iwlwifi/mvm/mvm.h
drivers/net/wireless/iwlwifi/mvm/time-event.c