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 <
[email protected]>
Fixes: b76b51ba0cef ('ACPI / EC: Add more debug info and trivial code cleanup')
References: http://crbug.com/319019
Signed-off-by: Puneet Kumar <[email protected]>
Reviewed-by: Aaron Durbin <[email protected]>
[olof: Commit message reworded a bit]
Signed-off-by: Olof Johansson <[email protected]>
Cc: 3.8+ <[email protected]> # 3.8+
Signed-off-by: Rafael J. Wysocki <[email protected]>
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) {