linux-stable/drivers/base
Rafael J. Wysocki 881363cbdd driver core: Extend device_is_dependent()
commit 3d1cf435e2 upstream.

If the device passed as the target (second argument) to
device_is_dependent() is not completely registered (that is, it has
been initialized, but not added yet), but the parent pointer of it
is set, it may be missing from the list of the parent's children
and device_for_each_child() called by device_is_dependent() cannot
be relied on to catch that dependency.

For this reason, modify device_is_dependent() to check the ancestors
of the target device by following its parent pointer in addition to
the device_for_each_child() walk.

Fixes: 9ed9895370 ("driver core: Functional dependencies tracking support")
Reported-by: Stephan Gerhold <stephan@gerhold.net>
Tested-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/17705994.d592GUb2YH@kreacher
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-27 11:55:18 +01:00
..
firmware_loader Char/Misc driver patches for 5.10-rc1 2020-10-15 10:01:51 -07:00
power PM: runtime: Drop pm_runtime_clean_up_links() 2020-11-02 18:14:07 +01:00
regmap regmap: debugfs: Fix a reversed if statement in regmap_debugfs_init() 2021-01-17 14:17:06 +01:00
test drivers: base: default KUNIT_* fragments to KUNIT_ALL_TESTS 2020-06-01 14:24:25 -06:00
arch_topology.c Driver Core patches for 5.10-rc1 2020-10-14 16:09:32 -07:00
attribute_container.c scsi: drivers: base: Support atomic version of attribute_container_device_trigger 2020-01-15 22:55:36 -05:00
base.h driver core: add deferring probe reason to devices_deferred property 2020-07-30 09:03:43 +02:00
bus.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
cacheinfo.c drivers core: Use sysfs_emit for shared_cpu_map_show and shared_cpu_list_show 2020-10-02 13:24:40 +02:00
class.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
component.c component: Silence bind error on -EPROBE_DEFER 2020-04-28 17:54:15 +02:00
container.c
core.c driver core: Extend device_is_dependent() 2021-01-27 11:55:18 +01:00
cpu.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
dd.c drivers core: Free dma_range_map when driver probe failed 2021-01-27 11:55:18 +01:00
devcoredump.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
devres.c devres: provide devm_krealloc() 2020-09-08 13:32:06 +02:00
devtmpfs.c init: add an init_chroot helper 2020-07-31 08:17:52 +02:00
driver.c drivers: base: Convert to printk alias functions 2020-07-10 14:16:44 +02:00
firmware.c
hypervisor.c
init.c
isa.c
Kconfig drivers: base: default KUNIT_* fragments to KUNIT_ALL_TESTS 2020-06-01 14:24:25 -06:00
Makefile device property: Move fwnode_connection_find_match() under drivers/base/property.c 2020-09-08 13:32:06 +02:00
map.c
memory.c mm/memory_hotplug: prepare passing flags to add_memory() and friends 2020-10-16 11:11:18 -07:00
module.c
node.c mm: don't panic when links can't be created in sysfs 2020-10-16 11:11:18 -07:00
pinctrl.c
platform-msi.c platform-msi: Fix typos in comment 2020-05-18 10:28:30 +01:00
platform.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
property.c device property: Move fwnode_connection_find_match() under drivers/base/property.c 2020-09-08 13:32:06 +02:00
soc.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
swnode.c software node: Use software_node_unregister() when unregistering group of nodes 2020-07-10 14:35:37 +02:00
syscore.c syscore: Use pm_pr_dbg() for syscore_{suspend,resume}() 2020-09-08 13:32:06 +02:00
topology.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
transport_class.c scsi: drivers: base: Propagate errors through the transport component 2020-01-15 22:55:37 -05:00