OSDN Git Service

brcmfmac: Fix race condition in msgbuf ioctl processing.
authorHante Meuleman <meuleman@broadcom.com>
Fri, 6 Mar 2015 17:40:41 +0000 (18:40 +0100)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 28 Apr 2015 16:49:37 +0000 (00:49 +0800)
commitabca44f133f522193edc49215d4a9e6569498748
tree735bb0d97d9fe226fee2c8c9f3e9f1e100bdbb8b
parent69bd4f61c059c8841e93f8b7e7b6d166583bb47f
brcmfmac: Fix race condition in msgbuf ioctl processing.

Msgbuf is using a wait_event_timeout to wait for the response on
an ioctl. The wakeup routine uses waitqueue_active to see if
wait_event_timeout has been called. There is a chance that the
response arrives before wait_event_timeout is called, this
will result in situation that wait_event_timeout never gets
woken again and assumed result will be a timeout. This patch
removes that errornous situation by always setting the
ctl_completed var before checking for queue active.

Reviewed-by: Arend Van Spriel <arend@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/msgbuf.c