From: Andrew Morton <akpm@linux-foundation.org>
To: Jingoo Han <jg1.han@samsung.com>
Cc: 'LKML' <linux-kernel@vger.kernel.org>,
linux-fbdev@vger.kernel.org, 'Richard Purdie' <rpurdie@rpsys.net>,
'Devendra Naga' <devendra.aaru@gmail.com>
Subject: Re: [PATCH] backlight: check null deference of name when device is registered
Date: Tue, 08 Jan 2013 00:01:37 +0000 [thread overview]
Message-ID: <20130107160137.dec5098a.akpm@linux-foundation.org> (raw)
In-Reply-To: <000b01cdea55$92725aa0$b7570fe0$%han@samsung.com>
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)?
If "no" then why don't we declare that "passing name=NULL is a bug" and
leave the code as-is?
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Jingoo Han <jg1.han@samsung.com>
Cc: "'LKML'" <linux-kernel@vger.kernel.org>,
linux-fbdev@vger.kernel.org,
"'Richard Purdie'" <rpurdie@rpsys.net>,
"'Devendra Naga'" <devendra.aaru@gmail.com>
Subject: Re: [PATCH] backlight: check null deference of name when device is registered
Date: Mon, 7 Jan 2013 16:01:37 -0800 [thread overview]
Message-ID: <20130107160137.dec5098a.akpm@linux-foundation.org> (raw)
In-Reply-To: <000b01cdea55$92725aa0$b7570fe0$%han@samsung.com>
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)?
If "no" then why don't we declare that "passing name=NULL is a bug" and
leave the code as-is?
next prev parent reply other threads:[~2013-01-08 0:01 UTC|newest]
Thread overview: 12+ 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-04 8:29 ` Jingoo Han
2013-01-08 0:01 ` Andrew Morton [this message]
2013-01-08 0:01 ` Andrew Morton
2013-01-08 1:25 ` Jingoo Han
2013-01-08 1:25 ` Jingoo Han
2013-01-08 1:35 ` Andrew Morton
2013-01-08 1:35 ` Andrew Morton
2013-01-08 1:39 ` Jingoo Han
2013-01-08 1:39 ` Jingoo Han
2013-01-08 4:28 ` devendra.aaru
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=20130107160137.dec5098a.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=devendra.aaru@gmail.com \
--cc=jg1.han@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.