From: Kevin Hilman <khilman@deeprootsystems.com>
To: "Mittal, Mukund" <mmittal@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH v3] OMAP: timer-gp: Fix for null pointer dereferencing issue
Date: Thu, 16 Jul 2009 14:10:37 -0700 [thread overview]
Message-ID: <87y6qoz642.fsf@deeprootsystems.com> (raw)
In-Reply-To: <EAF47CD23C76F840A9E7FCE10091EFAB02B57BB71E@dbde02.ent.ti.com> (Mukund Mittal's message of "Thu\, 16 Jul 2009 17\:51\:43 +0530")
"Mittal, Mukund" <mmittal@ti.com> writes:
> From: Mukund Mittal <mmittal@ti.com>
>
> OMAP: timer-gp: Fix for null pointer dereferencing issue
not exaclty a "fix". this patch will print a warning and
happily continue on and dereference the NULL.
> Calling WARN_ON() to warn for null pointer dereferencing for gpt pointer.
>
> Signed-off-by: Mukund Mittal <mmittal@ti.com>
> ---
> arch/arm/mach-omap2/timer-gp.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletion(-)
>
> Index: linux-omap-2.6/arch/arm/mach-omap2/timer-gp.c
> ===================================================================
> --- linux-omap-2.6.orig/arch/arm/mach-omap2/timer-gp.c
> +++ linux-omap-2.6/arch/arm/mach-omap2/timer-gp.c
> @@ -211,8 +211,10 @@ static void __init omap2_gp_clocksource_
> "%s: can't register clocksource!\n";
>
> gpt = omap_dm_timer_request();
> - if (!gpt)
> + if (!gpt) {
> printk(err1, clocksource_gpt.name);
> + WARN_ON(1);
> + }
What you want is something like this (untested):
if (WARN_ON(!gpt1, err1, clocksource_gpt.name))
return;
> gpt_clocksource = gpt;
>
> omap_dm_timer_set_source(gpt, OMAP_TIMER_SRC_SYS_CLK);
prev parent reply other threads:[~2009-07-16 21:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-16 12:21 [PATCH v3] OMAP: timer-gp: Fix for null pointer dereferencing issue Mittal, Mukund
2009-07-16 21:10 ` Kevin Hilman [this message]
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=87y6qoz642.fsf@deeprootsystems.com \
--to=khilman@deeprootsystems.com \
--cc=linux-omap@vger.kernel.org \
--cc=mmittal@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