brcmfmac: Fix race condition between USB probe/load and disconnect.
authorHante Meuleman <meuleman@broadcom.com>
Thu, 8 Oct 2015 18:33:12 +0000 (20:33 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 21 Oct 2015 07:56:39 +0000 (10:56 +0300)
commit185f0eb0b5fab0c9bfd7c5d322e2cd05b951d6e8
tree72dfe6af7ec61c156bb558580b3e90e2aa11764d
parentff4445a8502cdf06969540c92bb201ee47e70351
brcmfmac: Fix race condition between USB probe/load and disconnect.

When a USB device gets disconnected due to for example removal
then it is possible that it is still in the loading phase due to
the asynchronous load routines. These routines can then possible
access memory which has been freed. Fix this by mutex locking the
device init phase.

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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/brcm80211/brcmfmac/usb.c