From: "linyujun (C)" <linyujun809@huawei.com>
To: <daniel@zonque.org>, <haojian.zhuang@gmail.com>,
<robert.jarzmik@free.fr>, <linux@armlinux.org.uk>, <lg@denx.de>,
<eric.miao@marvell.com>
Cc: <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] ARM pxa2xx: Add missing platform_device_put() in pxa2xx_set_spi_info()
Date: Mon, 26 Sep 2022 17:14:36 +0800 [thread overview]
Message-ID: <fe9cc0b0-eec0-ce43-e424-2f8b835088a4@huawei.com> (raw)
In-Reply-To: <20220914033317.98469-1-linyujun809@huawei.com>
kindly ping
在 2022/9/14 11:33, Lin Yujun 写道:
> In error case in pxa2xx_set_spi_info() after calling
> platform_device_add(), the failed 'pdev' need to be
> release or it will be leak, call platform_device_put()
> to fix this problem.
>
> Fixes: e172274ccc55 ("[ARM] 5088/3: pxa2xx: add pxa2xx_set_spi_info to register pxa2xx-spi platform devices")
> Signed-off-by: Lin Yujun <linyujun809@huawei.com>
> ---
> arch/arm/mach-pxa/devices.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
> index a7b92dd1ca9e..2727f0138758 100644
> --- a/arch/arm/mach-pxa/devices.c
> +++ b/arch/arm/mach-pxa/devices.c
> @@ -1087,7 +1087,11 @@ void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_controller *info)
> }
>
> pd->dev.platform_data = info;
> - platform_device_add(pd);
> + if (platform_device_add(pd)) {
> + printk(KERN_ERR "pxa2xx-spi: failed to add platform device %d\n",
> + id);
> + platform_device_put(pd);
> + }
> }
>
> static struct resource pxa_dma_resource[] = {
prev parent reply other threads:[~2022-09-26 9:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-14 3:33 Lin Yujun
2022-09-26 9:14 ` linyujun (C) [this message]
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=fe9cc0b0-eec0-ce43-e424-2f8b835088a4@huawei.com \
--to=linyujun809@huawei.com \
--cc=daniel@zonque.org \
--cc=eric.miao@marvell.com \
--cc=haojian.zhuang@gmail.com \
--cc=lg@denx.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=robert.jarzmik@free.fr \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®