[lkml]   [2013]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 3.10 21/80] ACPI / EC: Ensure lock is acquired before accessing ec struct members
3.10-stable review patch.  If anyone has any objections, please let me know.


From: Puneet Kumar <>

commit 36b15875a7819a2ec4cb5748ff7096ad7bd86cbb upstream.

A bug was introduced by commit b76b51ba0cef ('ACPI / EC: Add more debug
info and trivial code cleanup') that erroneously caused the struct member
to be accessed before acquiring the required lock. This change fixes
it by ensuring the lock acquisition is done first.

Found by Aaron Durbin <>

Fixes: b76b51ba0cef ('ACPI / EC: Add more debug info and trivial code cleanup')
Signed-off-by: Puneet Kumar <>
Reviewed-by: Aaron Durbin <>
[olof: Commit message reworded a bit]
Signed-off-by: Olof Johansson <>
Signed-off-by: Rafael J. Wysocki <>
Signed-off-by: Greg Kroah-Hartman <>

drivers/acpi/ec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -175,9 +175,10 @@ static void start_transaction(struct acp
static void advance_transaction(struct acpi_ec *ec, u8 status)
unsigned long flags;
- struct transaction *t = ec->curr;
+ struct transaction *t;

spin_lock_irqsave(&ec->lock, flags);
+ t = ec->curr;
if (!t)
goto unlock;
if (t->wlen > t->wi) {

 \ /
  Last update: 2013-11-27 04:41    [W:0.243 / U:2.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site