summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
diff options
context:
space:
mode:
authorHante Meuleman <meuleman@broadcom.com>2012-11-14 18:46:18 -0800
committerJohn W. Linville <linville@tuxdriver.com>2012-11-16 14:28:59 -0500
commit37ac5780e08e4e3ce67e8355e52d71324e9c11cd (patch)
tree1b361725247c8b053c3f6405283250f9c8fcb482 /drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
parent1799ddf18597da5aa1319b089736aafd05481774 (diff)
downloadblackbird-obmc-linux-37ac5780e08e4e3ce67e8355e52d71324e9c11cd.tar.gz
blackbird-obmc-linux-37ac5780e08e4e3ce67e8355e52d71324e9c11cd.zip
brcmfmac: Handle mmc exceptions during init correct.
when brcmf_sdbrcm_probe_attach results in error then cleanup will result in null pointer access. In brcmf_sdbrcm_release and in brcmf_ops_sdio_remove. This patch fixes order of init and de-init. 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: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index c62ec2a5b271..854573386f23 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -512,6 +512,8 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
brcmf_dbg(TRACE, "F2 found, calling brcmf_sdio_probe...\n");
ret = brcmf_sdio_probe(sdiodev);
+ if (ret)
+ dev_set_drvdata(&func->dev, NULL);
}
return ret;
@@ -532,8 +534,12 @@ static void brcmf_ops_sdio_remove(struct sdio_func *func)
sdiodev = bus_if->bus_priv.sdio;
brcmf_dbg(TRACE, "F2 found, calling brcmf_sdio_remove...\n");
brcmf_sdio_remove(sdiodev);
- dev_set_drvdata(&func->card->dev, NULL);
dev_set_drvdata(&func->dev, NULL);
+ }
+ if (func->num == 1) {
+ sdiodev = dev_get_drvdata(&func->card->dev);
+ bus_if = sdiodev->bus_if;
+ dev_set_drvdata(&func->card->dev, NULL);
kfree(bus_if);
kfree(sdiodev);
}
OpenPOWER on IntegriCloud