From: Jingoo Han <jg1.han@samsung.com>
To: 'Andrew Morton' <akpm@linux-foundation.org>
Cc: 'LKML' <linux-kernel@vger.kernel.org>,
linux-fbdev@vger.kernel.org, 'Richard Purdie' <rpurdie@rpsys.net>,
'Devendra Naga' <devendra.aaru@gmail.com>,
'Jingoo Han' <jg1.han@samsung.com>
Subject: Re: [PATCH] backlight: check null deference of name when device is registered
Date: Tue, 08 Jan 2013 01:25:35 +0000 [thread overview]
Message-ID: <003c01cded3f$0f25a3e0$2d70eba0$%han@samsung.com> (raw)
In-Reply-To: <20130107160137.dec5098a.akpm@linux-foundation.org>
On Tuesday, January 08, 2013 9:02 AM, Andrew Morton wrote
> On Fri, 04 Jan 2013 17:29:11 +0900
> Jingoo Han <jg1.han@samsung.com> wrote:
>
> > NULL deference of name is checked when device is registered.
> > If the name is null, it will cause a kernel oops in dev_set_name().
> >
> > ...
> >
> > --- a/drivers/video/backlight/backlight.c
> > +++ b/drivers/video/backlight/backlight.c
> > @@ -292,6 +292,11 @@ struct backlight_device *backlight_device_register(const char *name,
> > struct backlight_device *new_bd;
> > int rc;
> >
> > + if (name = NULL) {
> > + pr_err("backlight name is null\n");
> > + return ERR_PTR(-EINVAL);
> > + }
> > +
> > pr_debug("backlight_device_register: name=%s\n", name);
>
> I don't understand this.
>
> Is there some driver which is calling these functions with name=NULL?
> If so, which one(s)?
No, there is no one.
>
> If "no" then why don't we declare that "passing name=NULL is a bug" and
> leave the code as-is?
Do you mean following?
+ if (name = NULL)
+ pr_err("passing name=NULL is a bug");
+
pr_debug("backlight_device_register: name=%s\n", name);
Best regards,
Jingoo Han
next prev parent reply other threads:[~2013-01-08 1:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-04 8:29 [PATCH] backlight: check null deference of name when device is registered Jingoo Han
2013-01-08 0:01 ` Andrew Morton
2013-01-08 1:25 ` Jingoo Han [this message]
2013-01-08 1:35 ` Andrew Morton
2013-01-08 1:39 ` Jingoo Han
2013-01-08 4:28 ` devendra.aaru
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='003c01cded3f$0f25a3e0$2d70eba0$%han@samsung.com' \
--to=jg1.han@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=devendra.aaru@gmail.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
/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;
as well as URLs for NNTP newsgroup(s).