brcmfmac: prevent possible race condition on usb rx control.
authorHante Meuleman <meuleman@broadcom.com>
Thu, 30 Aug 2012 17:42:58 +0000 (19:42 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 7 Sep 2012 19:03:42 +0000 (15:03 -0400)
commita77f57475465b1958f167c78dc94288ea0ba1b9c
tree0813459a05076a7efd474178e579b48a825a4de7
parentadfbda62248258a402253744e4eed6b87fb43169
brcmfmac: prevent possible race condition on usb rx control.

brcmf_usb_tx_ctlpkt sends message using brcmf_usb_send_ctl then
clears boolean and waits for boolean to be set (by another
thread). This can result in situation where flag gets cleared
while result was already received. First clearing the flag and
then sending the data will prevent this.

Reviewed-by: Arend Van Spriel (arend@broadcom.com)
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/usb.c