[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210513103745.2dzawk7c63ku2vz6@maple.lan>
Date: Thu, 13 May 2021 11:37:45 +0100
From: Daniel Thompson <daniel.thompson@...aro.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Lee Jones <lee.jones@...aro.org>, dri-devel@...ts.freedesktop.org,
linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Jingoo Han <jingoohan1@...il.com>,
Brian Masney <masneyb@...tation.org>,
Dan Murphy <dmurphy@...com>
Subject: Re: [PATCH v1 1/1] backlight: lm3630a_bl: Put fwnode in error case
during ->probe()
On Mon, May 10, 2021 at 12:57:16PM +0300, Andy Shevchenko wrote:
> device_for_each_child_node() bumps a reference counting of a returned variable.
> We have to balance it whenever we return to the caller.
>
> Fixes: 8fbce8efe15cd ("backlight: lm3630a: Add firmware node support")
> Cc: Brian Masney <masneyb@...tation.org>
> Cc: Dan Murphy <dmurphy@...com>
> Signed-off-by: Andy Shevchenko <andy.shevchenko@...il.com>
Reviewed-by: Daniel Thompson <daniel.thompson@...aro.org>
> ---
> drivers/video/backlight/lm3630a_bl.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c
> index e88a2b0e5904..662029d6a3dc 100644
> --- a/drivers/video/backlight/lm3630a_bl.c
> +++ b/drivers/video/backlight/lm3630a_bl.c
> @@ -482,8 +482,10 @@ static int lm3630a_parse_node(struct lm3630a_chip *pchip,
>
> device_for_each_child_node(pchip->dev, node) {
> ret = lm3630a_parse_bank(pdata, node, &seen_led_sources);
> - if (ret)
> + if (ret) {
> + fwnode_handle_put(node);
> return ret;
> + }
> }
>
> return ret;
> --
> 2.31.1
>
Powered by blists - more mailing lists