Re: [PATCH 1/2] bcma: Fix memory leak for internally-handled cores

From: Kalle Valo
Date: Sun Aug 29 2021 - 07:45:33 EST


Zenghui Yu <yuzenghui@xxxxxxxxxx> wrote:

> kmemleak reported that dev_name() of internally-handled cores were leaked
> on driver unbinding. Let's use device_initialize() to take refcounts for
> them and put_device() to properly free the related stuff.
>
> While looking at it, there's another potential issue for those which should
> be *registered* into driver core. If device_register() failed, we put
> device once and freed bcma_device structures. In bcma_unregister_cores(),
> they're treated as unregistered and we hit both UAF and double-free. That
> smells not good and has also been fixed now.
>
> Fixes: ab54bc8460b5 ("bcma: fill core details for every device")
> Signed-off-by: Zenghui Yu <yuzenghui@xxxxxxxxxx>

2 patches applied to wireless-drivers-next.git, thanks.

b63aed3ff195 bcma: Fix memory leak for internally-handled cores
9fc8048c56f3 bcma: Drop the unused parameter of bcma_scan_read32()

--
https://patchwork.kernel.org/project/linux-wireless/patch/20210727025232.663-2-yuzenghui@xxxxxxxxxx/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches