mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
net: wireless: bcm4329: Fix memleak in dev->p
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
This commit is contained in:
committed by
Colin Cross
parent
aa781dcc1a
commit
98ca2b1b29
@@ -301,7 +301,7 @@ int bcmsdh_remove(struct device *dev)
|
||||
MFREE(osh, sdhc, sizeof(bcmsdh_hc_t));
|
||||
osl_detach(osh);
|
||||
|
||||
#if !defined(BCMLXSDMMC)
|
||||
#if !defined(BCMLXSDMMC) || defined(OOB_INTR_ONLY)
|
||||
dev_set_drvdata(dev, NULL);
|
||||
#endif /* !defined(BCMLXSDMMC) */
|
||||
|
||||
@@ -647,10 +647,12 @@ void bcmsdh_unregister_oob_intr(void)
|
||||
{
|
||||
SDLX_MSG(("%s: Enter\n", __FUNCTION__));
|
||||
|
||||
set_irq_wake(sdhcinfo->oob_irq, 0);
|
||||
disable_irq(sdhcinfo->oob_irq); /* just in case.. */
|
||||
free_irq(sdhcinfo->oob_irq, NULL);
|
||||
sdhcinfo->oob_irq_registered = FALSE;
|
||||
if (sdhcinfo->oob_irq_registered) {
|
||||
set_irq_wake(sdhcinfo->oob_irq, 0);
|
||||
disable_irq(sdhcinfo->oob_irq); /* just in case.. */
|
||||
free_irq(sdhcinfo->oob_irq, NULL);
|
||||
sdhcinfo->oob_irq_registered = FALSE;
|
||||
}
|
||||
}
|
||||
#endif /* defined(OOB_INTR_ONLY) */
|
||||
/* Module parameters specific to each host-controller driver */
|
||||
|
||||
@@ -82,7 +82,6 @@ PBCMSDH_SDMMC_INSTANCE gInstance;
|
||||
|
||||
extern int bcmsdh_probe(struct device *dev);
|
||||
extern int bcmsdh_remove(struct device *dev);
|
||||
struct device sdmmc_dev;
|
||||
|
||||
static int bcmsdh_sdmmc_probe(struct sdio_func *func,
|
||||
const struct sdio_device_id *id)
|
||||
@@ -102,7 +101,7 @@ static int bcmsdh_sdmmc_probe(struct sdio_func *func,
|
||||
if(func->device == 0x4) { /* 4318 */
|
||||
gInstance->func[2] = NULL;
|
||||
sd_trace(("NIC found, calling bcmsdh_probe...\n"));
|
||||
ret = bcmsdh_probe(&sdmmc_dev);
|
||||
ret = bcmsdh_probe(&func->dev);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +109,7 @@ static int bcmsdh_sdmmc_probe(struct sdio_func *func,
|
||||
|
||||
if (func->num == 2) {
|
||||
sd_trace(("F2 found, calling bcmsdh_probe...\n"));
|
||||
ret = bcmsdh_probe(&sdmmc_dev);
|
||||
ret = bcmsdh_probe(&func->dev);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -126,7 +125,7 @@ static void bcmsdh_sdmmc_remove(struct sdio_func *func)
|
||||
|
||||
if (func->num == 2) {
|
||||
sd_trace(("F2 found, calling bcmsdh_remove...\n"));
|
||||
bcmsdh_remove(&sdmmc_dev);
|
||||
bcmsdh_remove(&func->dev);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,10 +249,8 @@ int sdio_function_init(void)
|
||||
if (!gInstance)
|
||||
return -ENOMEM;
|
||||
|
||||
bzero(&sdmmc_dev, sizeof(sdmmc_dev));
|
||||
error = sdio_register_driver(&bcmsdh_sdmmc_driver);
|
||||
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -265,7 +262,6 @@ void sdio_function_cleanup(void)
|
||||
{
|
||||
sd_trace(("%s Enter\n", __FUNCTION__));
|
||||
|
||||
|
||||
sdio_unregister_driver(&bcmsdh_sdmmc_driver);
|
||||
|
||||
if (gInstance)
|
||||
|
||||
Reference in New Issue
Block a user