ACPI / EC: Ensure lock is acquired before accessing ec struct members
authorPuneet Kumar <puneetster@chromium.org>
Fri, 15 Nov 2013 19:41:29 +0000 (11:41 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 6 Aug 2014 17:07:35 +0000 (18:07 +0100)
commit2934cf26e2b83e01a36fcb9ce5bfdb3209f2957e
tree354516c045bf893d4c34770b3874f16126c4648d
parentd5c85f63672263b2f8ea12ac1c1b925e793fdd0a
ACPI / EC: Ensure lock is acquired before accessing ec struct members

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 <adurbin@chromium.org>

Fixes: b76b51ba0cef ('ACPI / EC: Add more debug info and trivial code cleanup')
References: http://crbug.com/319019
Signed-off-by: Puneet Kumar <puneetster@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
[olof: Commit message reworded a bit]
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/acpi/ec.c