[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e3852bd4-f642-31f7-0855-c65669684d98@huawei.com>
Date: Mon, 26 Sep 2022 17:15:22 +0800
From: "linyujun (C)" <linyujun809@...wei.com>
To: <daniel@...que.org>, <haojian.zhuang@...il.com>,
<robert.jarzmik@...e.fr>, <linux@...linux.org.uk>,
<jayakumar.lkml@...il.com>
CC: <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] [ARM] am300epd: Release platform device in case of
platform_device_add_data() fails
kindly ping
在 2022/9/14 11:34, Lin Yujun 写道:
> The platform device need to be released when platform_device_add_data()
> fails. Use platform_device_put() to release 'pdev' in error path.
>
> Fixes: 4ce255c1420d ("[ARM] 5354/1: mach-pxa: add AM300 platform driver v3")
> Signed-off-by: Lin Yujun <linyujun809@...wei.com>
> ---
> arch/arm/mach-pxa/am300epd.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/am300epd.c b/arch/arm/mach-pxa/am300epd.c
> index 4b55bc89db8f..f8542b6aa9b7 100644
> --- a/arch/arm/mach-pxa/am300epd.c
> +++ b/arch/arm/mach-pxa/am300epd.c
> @@ -275,11 +275,14 @@ int __init am300_init(void)
> return -ENOMEM;
>
> /* the am300_board that will be seen by broadsheetfb is a copy */
> - platform_device_add_data(am300_device, &am300_board,
> + ret = platform_device_add_data(am300_device, &am300_board,
> sizeof(am300_board));
> + if (ret) {
> + platform_device_put(am300_device);
> + return ret;
> + }
>
> ret = platform_device_add(am300_device);
> -
> if (ret) {
> platform_device_put(am300_device);
> return ret;
Powered by blists - more mailing lists