mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Cong Ding <dinggnu@gmail.com>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] arm: kernel/perf_event_cpu.c: fix error null pointer dereference check
Date: Mon, 14 Jan 2013 17:40:20 +0000	[thread overview]
Message-ID: <20130114174020.GH31341@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <20130114173826.GA917@gmail.com>

On Mon, Jan 14, 2013 at 05:38:26PM +0000, Cong Ding wrote:
> On Mon, Jan 14, 2013 at 05:23:46PM +0000, Russell King - ARM Linux wrote:
> > On Mon, Jan 14, 2013 at 05:18:53PM +0000, Cong Ding wrote:
> > > the pointer cpu_pmu is used without null pointer dereference check, and is
> > > checked after the using of it, so we move the null pointer check to before the
> > > first use.
> > 
> > The NULL pointer check is not necessary.  cpu_pmu_init() is called
> > after cpu_pmu has already been dereferenced by its caller:
> > 
> >         cpu_pmu = pmu;
> >         cpu_pmu->plat_device = pdev;
> >         cpu_pmu_init(cpu_pmu);
> > 
> > So...
> > 
> > > -	/* Ensure the PMU has sane values out of reset. */
> > > -	if (cpu_pmu && cpu_pmu->reset)
> > 
> > Just replace this with:
> > 	if (cpu_pmu->reset)
> Thanks Russell, I will send version 2.

No need, I've taken this into my perf/updates branch.

Thanks,

Will

  reply	other threads:[~2013-01-14 17:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-14 17:18 Cong Ding
2013-01-14 17:23 ` Russell King - ARM Linux
2013-01-14 17:38   ` Cong Ding
2013-01-14 17:40     ` Will Deacon [this message]
2013-01-14 17:40 ` [PATCH v2] arm: kernel/perf_event_cpu.c: remove unnecessary " Cong Ding

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=20130114174020.GH31341@mudshark.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=dinggnu@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    /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

all inboxes | Powered by JetHome®