[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1308056600-17601-1-git-send-email-santosh.shilimkar@ti.com>
Date: Tue, 14 Jun 2011 18:33:20 +0530
From: Santosh Shilimkar <santosh.shilimkar@...com>
To: <linux-pm@...ts.linux-foundation.org>
CC: linux-kernel@...r.kernel.org, linux-omap@...r.kernel.org,
Santosh Shilimkar <santosh.shilimkar@...com>,
"Rafael J. Wysocki" <rjw@...k.pl>, Nishanth Menon <nm@...com>,
Kevin Hilman <khilman@...prootsystems.com>
Subject: [PATCH] power: opp: Fix rcu_dereference_check() without protection!
With RCU debug options enabled, below warning is observed.
===================================================
[ INFO: suspicious rcu_dereference_check() usage. ]
---------------------------------------------------
drivers/base/power/opp.c:151 invoked rcu_dereference_check() without protection!
other info that might help us debug this:
rcu_scheduler_active = 1, debug_locks = 1
no locks held by swapper/1.
...
---------------------------------------------------
Fix the same by protecting it with rcu_read lock.
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@...com>
Cc: Rafael J. Wysocki <rjw@...k.pl>
Cc: Nishanth Menon <nm@...com>
Cc: Kevin Hilman <khilman@...prootsystems.com>
---
drivers/base/power/opp.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 56a6899..cbed5e1 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -148,7 +148,9 @@ unsigned long opp_get_voltage(struct opp *opp)
struct opp *tmp_opp;
unsigned long v = 0;
+ rcu_read_lock();
tmp_opp = rcu_dereference(opp);
+ rcu_read_unlock();
if (unlikely(IS_ERR_OR_NULL(tmp_opp)) || !tmp_opp->available)
pr_err("%s: Invalid parameters\n", __func__);
else
--
1.6.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists