From ee450e3a2d334c7e6383d8a55ad2d53b3822bacc Mon Sep 17 00:00:00 2001 From: Alexey Charkov Date: Wed, 30 Sep 2026 20:07:45 +0400 Subject: [PATCH] PCI/pwrctrl: generic: Fix leaking array from of_regulator_bulk_get_all() of_regulator_bulk_get_all() allocates the consumers array and returns 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. Fixes: 75996c92f4de ("PCI/pwrctrl: Add pwrctrl driver for PCI slots") Signed-off-by: Alexey Charkov Signed-off-by: Bjorn Helgaas Reviewed-by: Bartosz Golaszewski Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260930-pci-pwrctrl-kfree-v1-1-f09bbffd8da3@flipper.net --- drivers/pci/pwrctrl/generic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/pwrctrl/generic.c b/drivers/pci/pwrctrl/generic.c index d56171e0ee24..4b6cbbb52248 100644 --- a/drivers/pci/pwrctrl/generic.c +++ b/drivers/pci/pwrctrl/generic.c @@ -63,6 +63,7 @@ static void devm_slot_pwrctrl_release(void *data) struct slot_pwrctrl *slot = data; regulator_bulk_free(slot->num_supplies, slot->supplies); + kfree(slot->supplies); } static int slot_pwrctrl_probe(struct platform_device *pdev) -- knotmirror 0.0.1