Skip to contentSkip to conversation

brcm80211:Fix locking region in the function brcmf_sdio_sendfromq

PATCH Arend van Spriel 1 participant 1 message Oct 4, 2015 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 16 lines · Nicholas Krause

This fixes the locking region in the function brcmf_sdio_sendfromq to properly lock around the call to the function brcmrf_sdio_txpkt in order to avoid concurrent access issues when calling this function as stated in the function's comments about the caller being required to lock around the call to this particular function.

---
  drivers/net/wireless/brcm80211/brcmfmac/sdio.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/brcm80211/brcmfmac/sdio.c +0 -0
index f990e3d..da59683 100644

drivers/net/wireless/brcm80211/brcmfmac/sdio.c static uint brcmf_sdio_sendfromq(struct brcmf_sdio *bus, uint maxframes) · line 2392

Quoted 6 lines
drivers/net/wireless/brcm80211/brcmfmac/sdio.c +0 -1
@@ -2388,11 +2388,11 @@ static uint brcmf_sdio_sendfromq(struct brcmf_sdio *bus, uint maxframes)
  				break;
  			__skb_queue_tail(&pktq, pkt);
  		}
-		spin_unlock_bh(&bus->txq_lock);
  		if (i == 0)
  			break;

So what if we break here. Seems you need to do unlock if i == 0 here.

Regards,
Arend

drivers/net/wireless/brcm80211/brcmfmac/sdio.c static uint brcmf_sdio_sendfromq(struct brcmf_sdio *bus, uint maxframes) · line 2398

Quoted 7 lines
drivers/net/wireless/brcm80211/brcmfmac/sdio.c +1 -0
  		ret = brcmf_sdio_txpkt(bus, &pktq, SDPCM_DATA_CHANNEL);
+		spin_unlock_bh(&bus->txq_lock);
 
  		cnt += i;
 
 

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html