From: "Arend van Spriel" <arend@broadcom.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: "Linux Wireless List" <linux-wireless@vger.kernel.org>,
"Hante Meuleman" <meuleman@broadcom.com>,
"Arend van Spriel" <arend@broadcom.com>
Subject: [PATCH 1/5] brcmfmac: prevent possible race condition on usb rx control.
Date: Thu, 30 Aug 2012 19:42:58 +0200 [thread overview]
Message-ID: <1346348582-20095-2-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1346348582-20095-1-git-send-email-arend@broadcom.com>
From: Hante Meuleman <meuleman@broadcom.com>
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>
---
drivers/net/wireless/brcm80211/brcmfmac/usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
index a299d42..ac1ed1f 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
@@ -366,13 +366,13 @@ static int brcmf_usb_tx_ctlpkt(struct device *dev, u8 *buf, u32 len)
if (test_and_set_bit(0, &devinfo->ctl_op))
return -EIO;
+ devinfo->ctl_completed = false;
err = brcmf_usb_send_ctl(devinfo, buf, len);
if (err) {
brcmf_dbg(ERROR, "fail %d bytes: %d\n", err, len);
return err;
}
- devinfo->ctl_completed = false;
timeout = brcmf_usb_ioctl_resp_wait(devinfo, &devinfo->ctl_completed,
&pending);
clear_bit(0, &devinfo->ctl_op);
--
1.7.9.5
next prev parent reply other threads:[~2012-08-30 17:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-30 17:42 [PATCH 0/5] brcmfmac: add support for new fullmac devices Arend van Spriel
2012-08-30 17:42 ` Arend van Spriel [this message]
2012-08-30 17:42 ` [PATCH 2/5] brcmfmac: add BCM43241 sdio interface driver support Arend van Spriel
2012-08-30 17:43 ` [PATCH 3/5] brcmfmac: Add 43242 USB support Arend van Spriel
2012-08-30 17:43 ` [PATCH 4/5] brcmfmac: Add 43143 " Arend van Spriel
2012-10-18 12:55 ` Hauke Mehrtens
2012-12-10 8:01 ` Rafał Miłecki
2012-08-30 17:43 ` [PATCH 5/5] brcmfmac: add callback for nl80211 testmode command Arend van Spriel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1346348582-20095-2-git-send-email-arend@broadcom.com \
--to=arend@broadcom.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=meuleman@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).