driver core: platform: fix race condition with driver_override
authorAdrian Salido <salidoa@google.com>
Tue, 25 Apr 2017 23:55:26 +0000 (16:55 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 19 Sep 2017 01:34:05 +0000 (02:34 +0100)
commit41184f7a493e76e6dbb2c9e741f22c43e5b7beed
treeae097930bc0fd4110c5408a677e416d9af334e8c
parent0b42e3d47d91b80f05f2f716a7a6f8a07889cb0f
driver core: platform: fix race condition with driver_override

The driver_override implementation is susceptible to race condition when
different threads are reading vs storing a different driver override.
Add locking to avoid race condition.

Fixes: 3d713e0e382e ("driver core: platform: add device binding path 'driver_override'")
Cc: stable@vger.kernel.org
Signed-off-by: Adrian Salido <salidoa@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name driver-core-platform-fix-race-condition-with-driver_.patch
drivers/base/platform.c