* [PATCH] b43: Fix a memory leak in b43_bus_dev_ssb_init
@ 2016-01-11 3:37 Jia-Ju Bai
[not found] ` <1452483457-568-1-git-send-email-baijiaju1990-9Onoh4P/yGk@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Jia-Ju Bai @ 2016-01-11 3:37 UTC (permalink / raw)
To: kvalo, zajec5, joe, davem, m, johannes.berg
Cc: linux-wireless, b43-dev, netdev, linux-kernel, Jia-Ju Bai
The memory allocated by kzalloc in b43_bus_dev_ssb_init is not freed.
This patch fixes the bug by adding kfree in b43_ssb_remove.
Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
---
drivers/net/wireless/b43/main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index ec013fb..6d251a0 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -5798,6 +5798,7 @@ static void b43_ssb_remove(struct ssb_device *sdev)
b43_leds_unregister(wl);
b43_wireless_exit(dev, wl);
+ kfree(dev);
}
static struct ssb_driver b43_ssb_driver = {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] b43: Fix a memory leak in b43_bus_dev_ssb_init
[not found] ` <1452483457-568-1-git-send-email-baijiaju1990-9Onoh4P/yGk@public.gmane.org>
@ 2016-01-11 16:21 ` Michael Büsch
2016-01-11 16:42 ` Rafał Miłecki
1 sibling, 0 replies; 3+ messages in thread
From: Michael Büsch @ 2016-01-11 16:21 UTC (permalink / raw)
To: Jia-Ju Bai
Cc: johannes.berg-ral2JQCrhuEAvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
b43-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
joe-6d6DIl74uiNBDgjK7y7TUQ, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
kvalo-sgV2jX0FEOL9JmXXK+q4OQ
[-- Attachment #1.1: Type: text/plain, Size: 1013 bytes --]
On Mon, 11 Jan 2016 11:37:36 +0800
Jia-Ju Bai <baijiaju1990-9Onoh4P/yGk@public.gmane.org> wrote:
> The memory allocated by kzalloc in b43_bus_dev_ssb_init is not freed.
> This patch fixes the bug by adding kfree in b43_ssb_remove.
>
> Signed-off-by: Jia-Ju Bai <baijiaju1990-9Onoh4P/yGk@public.gmane.org>
> ---
> drivers/net/wireless/b43/main.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
> index ec013fb..6d251a0 100644
> --- a/drivers/net/wireless/b43/main.c
> +++ b/drivers/net/wireless/b43/main.c
> @@ -5798,6 +5798,7 @@ static void b43_ssb_remove(struct ssb_device *sdev)
>
> b43_leds_unregister(wl);
> b43_wireless_exit(dev, wl);
> + kfree(dev);
> }
>
> static struct ssb_driver b43_ssb_driver = {
Nice catch.
The kfree is also missing in b43_bcma_remove().
And also in the error paths of b43_bcma_probe().
Can you please extend the patch to cover these, too?
--
Michael
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 179 bytes --]
_______________________________________________
b43-dev mailing list
b43-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
http://lists.infradead.org/mailman/listinfo/b43-dev
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] b43: Fix a memory leak in b43_bus_dev_ssb_init
[not found] ` <1452483457-568-1-git-send-email-baijiaju1990-9Onoh4P/yGk@public.gmane.org>
2016-01-11 16:21 ` Michael Büsch
@ 2016-01-11 16:42 ` Rafał Miłecki
1 sibling, 0 replies; 3+ messages in thread
From: Rafał Miłecki @ 2016-01-11 16:42 UTC (permalink / raw)
To: Jia-Ju Bai
Cc: Kalle Valo, Joe Perches, David Miller, Michael Büsch,
Johannes Berg,
linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, b43-dev,
Network Development, Linux Kernel Mailing List
On 11 January 2016 at 04:37, Jia-Ju Bai <baijiaju1990-9Onoh4P/yGk@public.gmane.org> wrote:
> The memory allocated by kzalloc in b43_bus_dev_ssb_init is not freed.
> This patch fixes the bug by adding kfree in b43_ssb_remove.
Nice. If you want somethig more to scratch your head, see
"Missing b43 firmware handling"
http://lists.infradead.org/pipermail/b43-dev/2014-June/003467.html
--
Rafał
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-01-11 16:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-11 3:37 [PATCH] b43: Fix a memory leak in b43_bus_dev_ssb_init Jia-Ju Bai
[not found] ` <1452483457-568-1-git-send-email-baijiaju1990-9Onoh4P/yGk@public.gmane.org>
2016-01-11 16:21 ` Michael Büsch
2016-01-11 16:42 ` Rafał Miłecki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).