提交 36b15875 编写于 作者: P Puneet Kumar 提交者: Rafael J. Wysocki

ACPI / EC: Ensure lock is acquired before accessing ec struct members

A bug was introduced by commit b76b51ba ('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 <adurbin@chromium.org>

Fixes: b76b51ba ('ACPI / EC: Add more debug info and trivial code cleanup')
References: http://crbug.com/319019Signed-off-by: NPuneet Kumar <puneetster@chromium.org>
Reviewed-by: NAaron Durbin <adurbin@chromium.org>
[olof: Commit message reworded a bit]
Signed-off-by: NOlof Johansson <olof@lixom.net>
Cc: 3.8+ <stable@vger.kernel.org> # 3.8+
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 5e01dc7b
......@@ -175,9 +175,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->lock, flags);
t = ec->curr;
if (!t)
goto unlock;
if (t->wlen > t->wi) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册