From: Pengyu Luo <mitltlatltl@gmail.com>
To: johan@kernel.org
Cc: bryan.odonoghue@linaro.org, hansg@kernel.org,
ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org,
mitltlatltl@gmail.com, platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH] platform: arm64: huawei-gaokun-ec: fix OF node leak
Date: Thu, 10 Jul 2025 20:11:37 +0800 [thread overview]
Message-ID: <20250710121138.228975-1-mitltlatltl@gmail.com> (raw)
In-Reply-To: <20250708085358.15657-1-johan@kernel.org>
On Tue, Jul 8, 2025 at 4:54 PM Johan Hovold <johan@kernel.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@gmail.com>
> Signed-off-by: Johan Hovold <johan@kernel.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@gmail.com>
Best wishes,
Pengyu
next prev parent reply other threads:[~2025-07-10 12:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-08 8:53 [PATCH] platform: arm64: huawei-gaokun-ec: fix OF node leak Johan Hovold
2025-07-10 12:11 ` Pengyu Luo [this message]
2025-07-11 16:26 ` Ilpo Järvinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250710121138.228975-1-mitltlatltl@gmail.com \
--to=mitltlatltl@gmail.com \
--cc=bryan.odonoghue@linaro.org \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.