android_kernel_motorola_sm6375/drivers/base
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Lukas Wunner d3c9e81500 driver core: Avoid binding drivers to dead devices
commit 654888327e9f655a9d55ad477a9583e90e8c9b5c upstream.

Commit 3451a495ef ("driver core: Establish order of operations for
device_add and device_del via bitflag") sought to prevent asynchronous
driver binding to a device which is being removed.  It added a
per-device "dead" flag which is checked in the following code paths:

* asynchronous binding in __driver_attach_async_helper()
*  synchronous binding in device_driver_attach()
* asynchronous binding in __device_attach_async_helper()

It did *not* check the flag upon:

*  synchronous binding in __device_attach()

However __device_attach() may also be called asynchronously from:

deferred_probe_work_func()
  bus_probe_device()
    device_initial_probe()
      __device_attach()

So if the commit's intention was to check the "dead" flag in all
asynchronous code paths, then a check is also necessary in
__device_attach().  Add the missing check.

Fixes: 3451a495ef ("driver core: Establish order of operations for device_add and device_del via bitflag")
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: stable@vger.kernel.org # v5.1+
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Link: https://lore.kernel.org/r/de88a23a6fe0ef70f7cfd13c8aea9ab51b4edab6.1594214103.git.lukas@wunner.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-21 13:05:26 +02:00
..
firmware_loader firmware: fix a double abort case with fw_load_sysfs_fallback 2020-04-17 10:50:05 +02:00
power PM: wakeup: Show statistics for deleted wakeup sources again 2020-07-31 18:39:32 +02:00
regmap regmap: debugfs: check count when read regmap file 2020-07-31 18:39:32 +02:00
test
arch_topology.c
attribute_container.c
base.h
bus.c
cacheinfo.c
class.c
component.c component: Silence bind error on -EPROBE_DEFER 2020-05-27 17:46:31 +02:00
container.c
core.c
cpu.c x86/speculation: Add Special Register Buffer Data Sampling (SRBDS) mitigation 2020-06-10 20:24:57 +02:00
dd.c driver core: Avoid binding drivers to dead devices 2020-08-21 13:05:26 +02:00
devcon.c
devcoredump.c
devres.c
devtmpfs.c
driver.c
firmware.c
hypervisor.c
init.c
isa.c
Kconfig
Makefile
map.c
memory.c drivers/base/memory.c: indicate all memory blocks as removable 2020-04-01 11:02:02 +02:00
module.c
node.c
pinctrl.c
platform-msi.c
platform.c drivers: base: Fix NULL pointer exception in __platform_driver_probe() if a driver developer is foolish 2020-06-24 17:50:24 +02:00
property.c
soc.c
swnode.c Revert "software node: Simplify software_node_release() function" 2020-05-10 10:31:30 +02:00
syscore.c
topology.c
transport_class.c