From: Dan Carpenter <dan.carpenter@oracle.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Anju T Sudhakar <anju@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Madhavan Srinivasan <maddy@linux.vnet.ibm.com>,
Hemant Kumar <hemant@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] powerpc/perf: double unlock bug in imc_common_cpuhp_mem_free()
Date: Fri, 11 Aug 2017 20:05:41 +0000 [thread overview]
Message-ID: <20170811200541.qlxcpp3og33sdki3@mwanda> (raw)
There is a typo so we call unlock instead of lock.
Fixes: 885dcd709ba9 ("powerpc/perf: Add nest IMC PMU support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I also don't understand how the &nest_imc_refc[node_id].lock works. Why
can't we use ref->lock everywhere? They seem equivalent, and my static
checker complains if we call the same lock different names.
diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
index 46cd912af060..52017f6eafd9 100644
--- a/arch/powerpc/perf/imc-pmu.c
+++ b/arch/powerpc/perf/imc-pmu.c
@@ -1124,7 +1124,7 @@ static void cleanup_all_thread_imc_memory(void)
static void imc_common_cpuhp_mem_free(struct imc_pmu *pmu_ptr)
{
if (pmu_ptr->domain = IMC_DOMAIN_NEST) {
- mutex_unlock(&nest_init_lock);
+ mutex_lock(&nest_init_lock);
if (nest_pmus = 1) {
cpuhp_remove_state(CPUHP_AP_PERF_POWERPC_NEST_IMC_ONLINE);
kfree(nest_imc_refc);
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Anju T Sudhakar <anju@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Madhavan Srinivasan <maddy@linux.vnet.ibm.com>,
Hemant Kumar <hemant@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] powerpc/perf: double unlock bug in imc_common_cpuhp_mem_free()
Date: Fri, 11 Aug 2017 23:05:41 +0300 [thread overview]
Message-ID: <20170811200541.qlxcpp3og33sdki3@mwanda> (raw)
There is a typo so we call unlock instead of lock.
Fixes: 885dcd709ba9 ("powerpc/perf: Add nest IMC PMU support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I also don't understand how the &nest_imc_refc[node_id].lock works. Why
can't we use ref->lock everywhere? They seem equivalent, and my static
checker complains if we call the same lock different names.
diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
index 46cd912af060..52017f6eafd9 100644
--- a/arch/powerpc/perf/imc-pmu.c
+++ b/arch/powerpc/perf/imc-pmu.c
@@ -1124,7 +1124,7 @@ static void cleanup_all_thread_imc_memory(void)
static void imc_common_cpuhp_mem_free(struct imc_pmu *pmu_ptr)
{
if (pmu_ptr->domain == IMC_DOMAIN_NEST) {
- mutex_unlock(&nest_init_lock);
+ mutex_lock(&nest_init_lock);
if (nest_pmus == 1) {
cpuhp_remove_state(CPUHP_AP_PERF_POWERPC_NEST_IMC_ONLINE);
kfree(nest_imc_refc);
next reply other threads:[~2017-08-11 20:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-11 20:05 Dan Carpenter [this message]
2017-08-11 20:05 ` [PATCH] powerpc/perf: double unlock bug in imc_common_cpuhp_mem_free() Dan Carpenter
2017-08-14 3:30 ` Michael Ellerman
2017-08-14 3:30 ` Michael Ellerman
2017-08-14 4:00 ` Madhavan Srinivasan
2017-08-14 4:12 ` Madhavan Srinivasan
2017-08-14 3:58 ` Madhavan Srinivasan
2017-08-14 3:59 ` Madhavan Srinivasan
2017-08-16 12:29 ` Michael Ellerman
2017-08-16 12:29 ` Michael Ellerman
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=20170811200541.qlxcpp3og33sdki3@mwanda \
--to=dan.carpenter@oracle.com \
--cc=anju@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=hemant@linux.vnet.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.vnet.ibm.com \
--cc=mpe@ellerman.id.au \
--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 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.