Skip to contentSkip to conversation

wireless: wl12xx, fix lock imbalance

PATCH In review Jiri Slaby 3 participants 5 messages Jul 14, 2009 – Jul 21, 2009 Networking drivers (wireless)

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH v2 1/1 wireless: wl12xx, fix lock imbalance

Add omitted mutex_unlock to one of wl12xx_op_start fail paths (when wl12xx_chip_wakeup fails).

[v2]
Power off the device, because:
\= cite from http://marc.info/?l=linux-kernel&m=124755028209880&w=2
If the chip cannot be booted, why should it remain powered on? In some rare cases, the chip might fail to initialize, but can recover if powered off and on again, so turning it off at this point is the right thing to do. =/

---
 drivers/net/wireless/wl12xx/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/wl12xx/main.c +1 -1
index 603d611..d30683c 100644
@@ -336,7 +336,7 @@ static int wl12xx_op_start(struct ieee80211_hw *hw)
 
 	ret = wl12xx_chip_wakeup(wl);
 	if (ret < 0)
-		return ret;
+		goto out;
 
 	ret = wl->chip.op_boot(wl);
 	if (ret < 0)
Signature · 1 line
1.6.3.2
Reviewed-by on v2 1/1
#1 lore raw
Quoted 11 lines · ext Jiri Slaby

Add omitted mutex_unlock to one of wl12xx_op_start fail paths (when wl12xx_chip_wakeup fails).

[v2]
Power off the device, because:
\= cite from http://marc.info/?l=linux-kernel&m=124755028209880&w=2
If the chip cannot be booted, why should it remain powered on? In some rare cases, the chip might fail to initialize, but can recover if powered off and on again, so turning it off at this point is the right thing to do. =/

Quoted 3 lines

---

Looks good now. Thanks!

Quoted 17 lines
 drivers/net/wireless/wl12xx/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/wl12xx/main.c +1 -1
index 603d611..d30683c 100644
@@ -336,7 +336,7 @@ static int wl12xx_op_start(struct ieee80211_hw *hw)
 
 	ret = wl12xx_chip_wakeup(wl);
 	if (ret < 0)
-		return ret;
+		goto out;
 
 	ret = wl->chip.op_boot(wl);
 	if (ret < 0)
Signature · 2 lines
Cheers,
Luca.
#2 lore raw
In reply to Jiri Slaby
Quoted 2 lines · Jiri Slaby

Add omitted mutex_unlock to one of wl12xx_op_start fail paths (when wl12xx_chip_wakeup fails).

Thanks for fixing this.

Quoted 7 lines

[v2]
Power off the device, because:
\= cite from http://marc.info/?l=linux-kernel&m=124755028209880&w=2
If the chip cannot be booted, why should it remain powered on? In some rare cases, the chip might fail to initialize, but can recover if powered off and on again, so turning it off at this point is the right thing to do. =/

Yes, I agree with this.

Quoted 3 lines
---
 drivers/net/wireless/wl12xx/main.c |    2 +-

Unfortunately this won't apply to wireless-testing because main.c is renamed to wl1251_main.c. Can you respin the patch or do you want me to do it? I'm sending other wl12xx patches anyway and it's easy for me to rebase this one at the same time.

Signature · 1 line
Kalle Valo
author
#3 lore raw
Quoted 9 lines · Kalle Valo
Quoted 3 lines
---
 drivers/net/wireless/wl12xx/main.c |    2 +-

Unfortunately this won't apply to wireless-testing because main.c is renamed to wl1251_main.c.
Can you respin the patch or do you want me to
do it? I'm sending other wl12xx patches anyway and it's easy for me to rebase this one at the same time.

It seems to be fixed now. But currently I'm confused by wl1251_plt_start and wl1251_plt_stop. They take a lock but doesn't unlock it at all. Neither their callies. Is it hidden somewhere deeper?

#4 lore raw
Quoted 3 lines · Jiri Slaby

But currently I'm confused by wl1251_plt_start and wl1251_plt_stop. They take a lock but doesn't unlock it at all. Neither their callies. Is it hidden somewhere deeper?

I guess that's a bug which creeped in when I ported the patches from our internal tree. I'll just remove plt start/stop functions altogether, they need to ported to the new nl80211 test mode interface anyway.

Oh damn, I just noticed that I added wl1251_netlink.c accidentally to wireless-testing tree. It should definitely not be there, instead we need to use nl80211 test command interface. I'll send a patch to remove the private netlink stuff soon. John, sorry about this.

Signature · 1 line
Kalle Valo