From: Nishanth Menon <nm@ti.com>
To: Rajendra Nayak <rnayak@ti.com>, linux-omap@vger.kernel.org
Cc: tony@atomide.com, dan.carpenter@oracle.com
Subject: Re: [PATCH] ARM: OMAP2+: Powerdomain: Fix unchecked dereference of arch_pwrdm
Date: Wed, 27 Nov 2013 19:55:40 -0600 [thread overview]
Message-ID: <5296A29C.50006@ti.com> (raw)
In-Reply-To: <1385553437-22568-1-git-send-email-rnayak@ti.com>
On 11/27/2013 05:57 AM, Rajendra Nayak wrote:
> Commit 'cd8abed' "ARM: OMAP2+: Powerdomain: Remove the need to
> always have a voltdm associated to a pwrdm" leads to the following
> Smatch complaint:
>
> arch/arm/mach-omap2/powerdomain.c:131 _pwrdm_register()
> error: we previously assumed 'arch_pwrdm' could be null (see line 105)
>
> So, fix the unchecked dereference of arch_pwrdm.
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Rajendra Nayak <rnayak@ti.com>
> ---
> arch/arm/mach-omap2/powerdomain.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
> index e233dfc..93a2a6e 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -128,7 +128,8 @@ skip_voltdm:
> for (i = 0; i < pwrdm->banks; i++)
> pwrdm->ret_mem_off_counter[i] = 0;
>
> - arch_pwrdm->pwrdm_wait_transition(pwrdm);
> + if (arch_pwrdm && arch_pwrdm->pwrdm_wait_transition)
> + arch_pwrdm->pwrdm_wait_transition(pwrdm);
> pwrdm->state = pwrdm_read_pwrst(pwrdm);
> pwrdm->state_counter[pwrdm->state] = 1;
>
>
Acked-by: Nishanth Menon <nm@ti.com>
--
Regards,
Nishanth Menon
next prev parent reply other threads:[~2013-11-28 1:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-27 11:57 [PATCH] ARM: OMAP2+: Powerdomain: Fix unchecked dereference of arch_pwrdm Rajendra Nayak
2013-11-28 1:55 ` Nishanth Menon [this message]
2013-12-02 19:20 ` Tony Lindgren
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=5296A29C.50006@ti.com \
--to=nm@ti.com \
--cc=dan.carpenter@oracle.com \
--cc=linux-omap@vger.kernel.org \
--cc=rnayak@ti.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.