linux-uconsole/drivers/base
Heikki Krogerus 2f13bd8f39 UPSTREAM: software node: Handle software node injection to an existing device properly
The function software_node_notify() - the function that creates
and removes the symlinks between the node and the device - was
called unconditionally in device_add_software_node() and
device_remove_software_node(), but it needs to be called in
those functions only in the special case where the node is
added to a device that has already been registered.

This fixes NULL pointer dereference that happens if
device_remove_software_node() is used with device that was
never registered.

Fixes: b622b24519 ("software node: Allow node addition to already existing device")
Reported-and-tested-by: Dominik Brodowski <linux@dominikbrodowski.net>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 5dca69e26f)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I1caca7eaaf76e9b6e48151cecf2219743690ba93
2021-08-27 12:26:09 -07:00
..
firmware_loader Char/Misc driver patches for 5.10-rc1 2020-10-15 10:01:51 -07:00
power ANDROID: power: wakeup_reason: change abort log 2021-06-25 16:31:57 +00:00
regmap regmap: set debugfs_name to NULL after it is freed 2021-05-14 09:50:09 +02:00
test drivers/base: build kunit tests without structleak plugin 2021-03-17 17:06:24 +01:00
arch_topology.c ANDROID: topology: Add flag to indicate topology has been updated 2021-05-11 22:55:07 +00:00
attribute_container.c
base.h UPSTREAM: Revert "driver core: fw_devlink: Add support for batching fwnode parsing" 2021-01-21 18:01:50 -08: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
container.c
core.c FROMGIT: drivers: base: Reduce device link removal code duplication 2021-06-04 11:15:18 -07:00
cpu.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
dd.c Merge 5.10.30 into android12-5.10 2021-04-15 14:23:41 +02: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 devtmpfs: fix placement of complete() call 2021-05-14 09:50:11 +02:00
driver.c
firmware.c
hypervisor.c
init.c
isa.c
Kconfig
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 drivers/base/memory: don't store phys_device in memory blocks 2021-03-17 17:06:25 +01:00
module.c
node.c node: fix device cleanups in error handling code 2021-05-14 09:50:19 +02:00
pinctrl.c
platform-msi.c
platform.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
property.c UPSTREAM: device property: Add fwnode_is_ancestor_of() and fwnode_get_next_parent_dev() 2021-01-21 18:04:03 -08:00
soc.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
swnode.c UPSTREAM: software node: Handle software node injection to an existing device properly 2021-08-27 12:26:09 -07:00
syscore.c Merge 3e4fb4346c ("Merge tag 'spdx-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx") into android-mailine 2020-10-26 07:05:05 +01:00
topology.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
transport_class.c