[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250710121138.228975-1-mitltlatltl@gmail.com>
Date: Thu, 10 Jul 2025 20:11:37 +0800
From: Pengyu Luo <mitltlatltl@...il.com>
To: johan@...nel.org
Cc: bryan.odonoghue@...aro.org,
hansg@...nel.org,
ilpo.jarvinen@...ux.intel.com,
linux-kernel@...r.kernel.org,
mitltlatltl@...il.com,
platform-driver-x86@...r.kernel.org
Subject: Re: [PATCH] platform: arm64: huawei-gaokun-ec: fix OF node leak
On Tue, Jul 8, 2025 at 4:54 PM Johan Hovold <johan@...nel.org> wrote:
> Make sure to drop the OF node reference taken when creating the Gaokun
> auxiliary devices when the devices are later released.
>
> Fixes: 7636f090d02e ("platform: arm64: add Huawei Matebook E Go EC driver")
> Cc: Pengyu Luo <mitltlatltl@...il.com>
> Signed-off-by: Johan Hovold <johan@...nel.org>
> ---
> drivers/platform/arm64/huawei-gaokun-ec.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/platform/arm64/huawei-gaokun-ec.c b/drivers/platform/arm64/huawei-gaokun-ec.c
> index 7e5aa7ca2403..7170f8eb76f7 100644
> --- a/drivers/platform/arm64/huawei-gaokun-ec.c
> +++ b/drivers/platform/arm64/huawei-gaokun-ec.c
> @@ -662,6 +662,7 @@ static void gaokun_aux_release(struct device *dev)
> {
> struct auxiliary_device *adev = to_auxiliary_dev(dev);
>
> + of_node_put(dev->of_node);
> kfree(adev);
> }
>
> @@ -693,6 +694,7 @@ static int gaokun_aux_init(struct device *parent, const char *name,
>
> ret = auxiliary_device_init(adev);
> if (ret) {
> + of_node_put(adev->dev.of_node);
> kfree(adev);
> return ret;
> }
> --
> 2.49.0
>
Oh, I should have checked `device_set_of_node_from_dev`, but I forgot,
thanks for fixing this.
Reviewed-by: Pengyu Luo <mitltlatltl@...il.com>
Best wishes,
Pengyu
Powered by blists - more mailing lists