2011-11-30 08:50:44

by Dan Carpenter

[permalink] [raw]
Subject: [patch] brcm80211: fmac: small memory leak on error

We should free "bus_if" here, it's a small leak but it makes the static
checkers happy.

Signed-off-by: Dan Carpenter <[email protected]>

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 77f84f8..b416e27 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -477,8 +477,10 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
if (!bus_if)
return -ENOMEM;
sdiodev = kzalloc(sizeof(struct brcmf_sdio_dev), GFP_KERNEL);
- if (!sdiodev)
+ if (!sdiodev) {
+ kfree(bus_if);
return -ENOMEM;
+ }
sdiodev->dev = &func->card->dev;
sdiodev->func[0] = func->card->sdio_func[0];
sdiodev->func[1] = func;


2011-11-30 18:43:00

by Franky Lin

[permalink] [raw]
Subject: Re: [patch] brcm80211: fmac: small memory leak on error

On 11/30/2011 12:49 AM, Dan Carpenter wrote:
> We should free "bus_if" here, it's a small leak but it makes the static
> checkers happy.
>
> Signed-off-by: Dan Carpenter<[email protected]>

Thanks, Dan.

Acked-by: Franky Lin <[email protected]>

Franky