From: Jingoo Han <jg1.han@samsung.com>
To: "'Andrew Morton'" <akpm@linux-foundation.org>
Cc: "'Levente Kurusa'" <levex@linux.com>,
"'LKML'" <linux-kernel@vger.kernel.org>,
"'Jean-Christophe Plagniol-Villard'" <plagnioj@jcrosoft.com>,
"'Tomi Valkeinen'" <tomi.valkeinen@ti.com>,
"'FBDEV list'" <linux-fbdev@vger.kernel.org>,
"'Bryan Wu'" <cooloney@gmail.com>,
"'Lee Jones'" <lee.jones@linaro.org>,
"'Jingoo Han'" <jg1.han@samsung.com>
Subject: Re: [PATCH] backlight: replace kfree with put_device
Date: Mon, 10 Feb 2014 09:22:44 +0900 [thread overview]
Message-ID: <003701cf25f6$3807c6d0$a8175470$%han@samsung.com> (raw)
In-Reply-To: <1391762601-4560-1-git-send-email-levex@linux.com>
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@linux.com>
(+cc Bryan Wu, Lee Jones)
Acked-by: Jingoo Han <jg1.han@samsung.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
next prev parent reply other threads:[~2014-02-10 0:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-07 8:43 Levente Kurusa
2014-02-10 0:22 ` Jingoo Han [this message]
2014-02-10 11:13 ` Lee Jones
2014-02-10 17:37 ` Bryan Wu
2014-02-10 17:47 ` Lee Jones
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='003701cf25f6$3807c6d0$a8175470$%han@samsung.com' \
--to=jg1.han@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=cooloney@gmail.com \
--cc=lee.jones@linaro.org \
--cc=levex@linux.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=plagnioj@jcrosoft.com \
--cc=tomi.valkeinen@ti.com \
/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®