ACPI / EC: Ensure lock is acquired before accessing ec struct members
[pandora-kernel.git] / drivers / acpi / ec.c
index 75a12f1..692d216 100644 (file)
@@ -178,9 +178,10 @@ static void start_transaction(struct acpi_ec *ec)
 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->curr_lock, flags);
+       t = ec->curr;
        if (!t)
                goto unlock;
        if (t->wlen > t->wi) {