[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <003701cf25f6$3807c6d0$a8175470$%han@samsung.com>
Date: Mon, 10 Feb 2014 09:22:44 +0900
From: Jingoo Han <jg1.han@...sung.com>
To: 'Andrew Morton' <akpm@...ux-foundation.org>
Cc: 'Levente Kurusa' <levex@...ux.com>,
'LKML' <linux-kernel@...r.kernel.org>,
'Jean-Christophe Plagniol-Villard' <plagnioj@...osoft.com>,
'Tomi Valkeinen' <tomi.valkeinen@...com>,
'FBDEV list' <linux-fbdev@...r.kernel.org>,
'Bryan Wu' <cooloney@...il.com>,
'Lee Jones' <lee.jones@...aro.org>,
'Jingoo Han' <jg1.han@...sung.com>
Subject: Re: [PATCH] backlight: replace kfree with put_device
On Friday, February 07, 2014 5:43 PM, Levente Kurusa wrote:
>
> As per the comments on device_register, we shouldn't call kfree()
> right after a device_register() failure. Instead call put_device(),
> which in turn will call bl_device_release resulting in a kfree to the
> full structure.
>
> Signed-off-by: Levente Kurusa <levex@...ux.com>
(+cc Bryan Wu, Lee Jones)
Acked-by: Jingoo Han <jg1.han@...sung.com>
Best regards,
Jingoo Han
> ---
> drivers/video/backlight/backlight.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
> index 5d05555..20b276e 100644
> --- a/drivers/video/backlight/backlight.c
> +++ b/drivers/video/backlight/backlight.c
> @@ -333,7 +333,7 @@ struct backlight_device *backlight_device_register(const char *name,
>
> rc = device_register(&new_bd->dev);
> if (rc) {
> - kfree(new_bd);
> + put_device(&new_bd->dev);
> return ERR_PTR(rc);
> }
>
> --
> 1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists