From: dinggnu@gmail.com (Cong Ding)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] arm: kernel/perf_event_cpu.c: remove unnecessary null pointer dereference check
Date: Mon, 14 Jan 2013 17:40:55 +0000 [thread overview]
Message-ID: <20130114174055.GB917@gmail.com> (raw)
In-Reply-To: <1358183933-29160-1-git-send-email-dinggnu@gmail.com>
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);
Signed-off-by: Cong Ding <dinggnu@gmail.com>
---
arch/arm/kernel/perf_event_cpu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c
index efa5295..43496f6 100644
--- a/arch/arm/kernel/perf_event_cpu.c
+++ b/arch/arm/kernel/perf_event_cpu.c
@@ -147,7 +147,7 @@ static void cpu_pmu_init(struct arm_pmu *cpu_pmu)
cpu_pmu->free_irq = cpu_pmu_free_irq;
/* Ensure the PMU has sane values out of reset. */
- if (cpu_pmu && cpu_pmu->reset)
+ if (cpu_pmu->reset)
on_each_cpu(cpu_pmu->reset, cpu_pmu, 1);
}
--
1.7.4.5
prev parent reply other threads:[~2013-01-14 17:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-14 17:18 [PATCH] arm: kernel/perf_event_cpu.c: fix error null pointer dereference check 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
2013-01-14 17:40 ` Cong Ding [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=20130114174055.GB917@gmail.com \
--to=dinggnu@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).