[PATCH] wifi: plfxlc: remove assert for mac->lock

Edward Adam Davis posted 1 patch 1 year, 4 months ago
drivers/net/wireless/purelifi/plfxlc/mac.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] wifi: plfxlc: remove assert for mac->lock
Posted by Edward Adam Davis 1 year, 4 months ago
syzbot report WARNING in plfxlc_mac_release, according to the context,
there is not need assert for mac->lock.

Fixes: 68d57a07bfe5 ("wireless: add plfxlc driver for pureLiFi X, XL, XC devices")
Reported-and-tested-by: syzbot+51a42f7c2e399392ea82@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=51a42f7c2e399392ea82
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
---
 drivers/net/wireless/purelifi/plfxlc/mac.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/purelifi/plfxlc/mac.c b/drivers/net/wireless/purelifi/plfxlc/mac.c
index 641f847d47ab..f603fddead90 100644
--- a/drivers/net/wireless/purelifi/plfxlc/mac.c
+++ b/drivers/net/wireless/purelifi/plfxlc/mac.c
@@ -102,7 +102,6 @@ int plfxlc_mac_init_hw(struct ieee80211_hw *hw)
 void plfxlc_mac_release(struct plfxlc_mac *mac)
 {
 	plfxlc_chip_release(&mac->chip);
-	lockdep_assert_held(&mac->lock);
 }
 
 int plfxlc_op_start(struct ieee80211_hw *hw)
-- 
2.43.0
Re: [PATCH] wifi: plfxlc: remove assert for mac->lock
Posted by Kalle Valo 1 year, 4 months ago
Edward Adam Davis <eadavis@qq.com> writes:

> syzbot report WARNING in plfxlc_mac_release, according to the context,
> there is not need assert for mac->lock.

The commit message should explain _why_ the assert is not needed.
Otherwise it looks that you are randomly removing it to get rid of the
warning.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Re: [PATCH] wifi: plfxlc: remove assert for mac->lock
Posted by Edward Adam Davis 1 year, 4 months ago
On Tue, 30 Jul 2024 13:35:07 +0300, Kalle Valo wrote:
> > syzbot report WARNING in plfxlc_mac_release, according to the context,
> > there is not need assert for mac->lock.
> 
> The commit message should explain _why_ the assert is not needed.
> Otherwise it looks that you are randomly removing it to get rid of the
> warning.
mac->lock is used to protect mac data, but after calling plfxlc_mac_release(), 
there are two functions:ieee80211_unregister_hw() and ieee80211_free_hw(),
there is no action to operate on mac data in these two functions, so mac->lock
is not required.

On the other hand, there is no holding action for mac->lock before calling plfxlc_mac_release.

--
Edward