All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: Igor Grinberg <grinberg@compulab.co.il>
Cc: linux-arm-kernel@lists.infradead.org,
	Tony Lindgren <tony@atomide.com>,
	linux-omap@vger.kernel.org, Paul Walmsley <paul@pwsan.com>,
	Kevin Hilman <khilman@ti.com>
Subject: Re: [PATCH] ARM: OMAP: avoid NULL pointer dereference when no PMIC is configured
Date: Tue, 20 Dec 2011 11:00:31 +0100	[thread overview]
Message-ID: <4EF05CBF.4010007@gmail.com> (raw)
In-Reply-To: <4EEEF163.7030608@compulab.co.il>

Hi Igor,

On 12/19/2011 09:10 AM, Igor Grinberg wrote:
> On 12/18/11 21:13, Daniel Mack wrote:
>> Signed-off-by: Daniel Mack <zonque@gmail.com>
>> Cc: Tony Lindgren <tony@atomide.com>
>> ---
>>  arch/arm/mach-omap2/vp.c |    5 +++++
>>  1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c
>> index 66bd700..5407173 100644
>> --- a/arch/arm/mach-omap2/vp.c
>> +++ b/arch/arm/mach-omap2/vp.c
>> @@ -41,6 +41,11 @@ void __init omap_vp_init(struct voltagedomain *voltdm)
>>  	u32 val, sys_clk_rate, timeout, waittime;
>>  	u32 vddmin, vddmax, vstepmin, vstepmax;
>>  
>> +	if (!voltdm->pmic) {
>> +		pr_err("%s: No PMIC configured.\n", __func__, voltdm->name);
> 
> You are passing two parameters to pr_err(), but use only one...

Of course not. I wonder why the compiler didn't yell at me about that.

> Also, I don't know if this is the right thing to do here,
> so Cc'ed Paul and Kevin.

That is the other question ideed. In the case I was facing on a custom
board, I was running into this without any configured PMIC. Clearly,
derferencing a NULL pointer here is no good thing to do.



Thanks,
Daniel




WARNING: multiple messages have this Message-ID (diff)
From: zonque@gmail.com (Daniel Mack)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: OMAP: avoid NULL pointer dereference when no PMIC is configured
Date: Tue, 20 Dec 2011 11:00:31 +0100	[thread overview]
Message-ID: <4EF05CBF.4010007@gmail.com> (raw)
In-Reply-To: <4EEEF163.7030608@compulab.co.il>

Hi Igor,

On 12/19/2011 09:10 AM, Igor Grinberg wrote:
> On 12/18/11 21:13, Daniel Mack wrote:
>> Signed-off-by: Daniel Mack <zonque@gmail.com>
>> Cc: Tony Lindgren <tony@atomide.com>
>> ---
>>  arch/arm/mach-omap2/vp.c |    5 +++++
>>  1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c
>> index 66bd700..5407173 100644
>> --- a/arch/arm/mach-omap2/vp.c
>> +++ b/arch/arm/mach-omap2/vp.c
>> @@ -41,6 +41,11 @@ void __init omap_vp_init(struct voltagedomain *voltdm)
>>  	u32 val, sys_clk_rate, timeout, waittime;
>>  	u32 vddmin, vddmax, vstepmin, vstepmax;
>>  
>> +	if (!voltdm->pmic) {
>> +		pr_err("%s: No PMIC configured.\n", __func__, voltdm->name);
> 
> You are passing two parameters to pr_err(), but use only one...

Of course not. I wonder why the compiler didn't yell at me about that.

> Also, I don't know if this is the right thing to do here,
> so Cc'ed Paul and Kevin.

That is the other question ideed. In the case I was facing on a custom
board, I was running into this without any configured PMIC. Clearly,
derferencing a NULL pointer here is no good thing to do.



Thanks,
Daniel

  reply	other threads:[~2011-12-20 10:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-18 19:13 [PATCH] ARM: OMAP: avoid NULL pointer dereference when no PMIC is configured Daniel Mack
2011-12-18 19:13 ` Daniel Mack
2011-12-19  8:10 ` Igor Grinberg
2011-12-19  8:10   ` Igor Grinberg
2011-12-20 10:00   ` Daniel Mack [this message]
2011-12-20 10:00     ` Daniel Mack

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=4EF05CBF.4010007@gmail.com \
    --to=zonque@gmail.com \
    --cc=grinberg@compulab.co.il \
    --cc=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=tony@atomide.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 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.