Re: [PATCH] PCI/pwrctrl: generic: Fix leaking array from of_regulator_bulk_get_all()
From: Bartosz Golaszewski
Date: Thu Oct 01 2026 - 10:48:30 EST
On Wed, 30 Sep 2026 18:07:45 +0200, Alexey Charkov <alchark@xxxxxxxxxxx> said:
> of_regulator_bulk_get_all() allocates the consumers array and hands it to
> the caller, who is expected to free it at an appropriate time.
> PCI pwrctrl never did, leading to a memory leak.
>
> Add an explicit kfree() for the consumers array.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 75996c92f4de ("PCI/pwrctrl: Add pwrctrl driver for PCI slots")
> Signed-off-by: Alexey Charkov <alchark@xxxxxxxxxxx>
> ---
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>