net: wireless: bcmdhd: Fix memleak in dev->p
Dmitry Shmidt [Mon, 13 Jun 2011 23:28:59 +0000 (16:28 -0700)]
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c

index b35859d..c73e04c 100644 (file)
@@ -86,7 +86,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)
@@ -106,7 +105,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);
                }
        }
 
@@ -117,7 +116,7 @@ static int bcmsdh_sdmmc_probe(struct sdio_func *func,
                wl_cfg80211_set_sdio_func(func);
 #endif
                sd_trace(("F2 found, calling bcmsdh_probe...\n"));
-               ret = bcmsdh_probe(&sdmmc_dev);
+               ret = bcmsdh_probe(&func->dev);
        }
 
        return ret;
@@ -133,7 +132,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);
        }
 }
 
@@ -258,7 +257,6 @@ int sdio_function_init(void)
        if (!gInstance)
                return -ENOMEM;
 
-       bzero(&sdmmc_dev, sizeof(sdmmc_dev));
        error = sdio_register_driver(&bcmsdh_sdmmc_driver);