From: Franky Lin Date: Thu, 9 Feb 2012 20:09:01 +0000 (+0100) Subject: brcm80211: fmac: make sure cancel_work_sync only called after INIT_WORK X-Git-Tag: v3.4-rc1~177^2~108^2~339 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89fdb468e201c16b31d3337b68993bc9f763a5a0;p=platform%2Fkernel%2Flinux-3.10.git brcm80211: fmac: make sure cancel_work_sync only called after INIT_WORK INIT_WORK only gets called after brcmf_proto_attach returns success. This dependency should be annotated in brcmf_detach to avoid any error. Reviewed-by: Pieter-Paul Giesberts Signed-off-by: Franky Lin Signed-off-by: Arend van Spriel Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c index db2df1f..eff0073 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c @@ -1109,13 +1109,13 @@ void brcmf_detach(struct device *dev) if (drvr->iflist[i]) brcmf_del_if(drvr, i); - cancel_work_sync(&drvr->setmacaddr_work); - cancel_work_sync(&drvr->multicast_work); - brcmf_bus_detach(drvr); - if (drvr->prot) + if (drvr->prot) { + cancel_work_sync(&drvr->setmacaddr_work); + cancel_work_sync(&drvr->multicast_work); brcmf_proto_detach(drvr); + } bus_if->drvr = NULL; kfree(drvr);