linux-stable/drivers/base
Christophe JAILLET eca2c185bb drivers/base/memory: fix an unlikely reference counting issue in __add_memory_block()
[ Upstream commit f47f758cff ]

__add_memory_block() calls both put_device() and device_unregister() when
storing the memory block into the xarray.  This is incorrect because
xarray doesn't take an additional reference and device_unregister()
already calls put_device().

Triggering the issue looks really unlikely and its only effect should be
to log a spurious warning about a ref counted issue.

Link: https://lkml.kernel.org/r/d44c63d78affe844f020dc02ad6af29abc448fc4.1650611702.git.christophe.jaillet@wanadoo.fr
Fixes: 4fb6eabf10 ("drivers/base/memory.c: cache memory blocks in xarray to accelerate lookup")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Scott Cheloha <cheloha@linux.vnet.ibm.com>
Cc: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:23:09 +02:00
..
firmware_loader firmware_loader: use kernel credentials when reading firmware 2022-05-18 10:26:53 +02:00
power PM: domains: Fix initialization of genpd's next_wakeup 2022-06-09 10:23:01 +02:00
regmap regmap-irq: Update interrupt clear register for proper reset 2022-03-02 11:48:01 +01:00
test device property: build kunit tests without structleak plugin 2021-10-06 17:53:42 -06:00
arch_numa.c memblock: introduce saner 'memblock_free_ptr()' interface 2021-09-14 13:23:22 -07:00
arch_topology.c arch_topology: Do not set llc_sibling if llc_id is invalid 2022-05-09 09:14:30 +02:00
attribute_container.c driver core: attribute_container: fix W=1 warnings 2021-05-14 13:37:10 +02:00
auxiliary.c Merge 5.14-rc3 into driver-core-next 2021-07-27 09:22:08 +02:00
base.h software nodes: Split software_node_notify() 2021-07-16 19:17:05 +02:00
bus.c driver: base: Replace symbolic permissions with octal permissions 2021-07-21 14:56:00 +02:00
cacheinfo.c cacheinfo: clear cache_leaves(cpu) in free_cache_attributes() 2021-07-21 17:29:40 +02:00
class.c drivers: base: fix some kernel-doc markups 2020-11-09 18:56:49 +01:00
component.c component: do not leave master devres group open after bind 2021-11-18 19:16:08 +01:00
container.c
core.c PM: runtime: Add safety net to supplier device release 2022-01-27 11:04:44 +01:00
cpu.c driver: base: Prefer unsigned int to bare use of unsigned 2021-07-21 17:30:09 +02:00
dd.c net: mdio: don't defer probe forever if PHY IRQ provider is missing 2022-04-20 09:34:10 +02:00
devcoredump.c devcoredump: remove contact information 2021-06-04 15:05:44 +02:00
devres.c devres: Enable trace events 2021-06-15 17:14:36 +02:00
devtmpfs.c devtmpfs regression fix: reconfigure on each mount 2022-01-20 09:13:13 +01:00
driver.c
firmware.c
hypervisor.c
init.c driver core: auxiliary bus: Fix calling stage for auxiliary bus init 2021-02-11 08:43:03 +01:00
isa.c bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
Kconfig RISC-V Patches for the 5.12 Merge Window 2021-02-26 10:28:35 -08:00
Makefile devres: Enable trace events 2021-06-15 17:14:36 +02:00
map.c driver: base: Prefer unsigned int to bare use of unsigned 2021-07-21 17:30:09 +02:00
memory.c drivers/base/memory: fix an unlikely reference counting issue in __add_memory_block() 2022-06-09 10:23:09 +02:00
module.c
node.c drivers/base/node.c: fix compaction sysfs file leak 2022-06-09 10:23:08 +02:00
pinctrl.c
platform-msi.c platform-msi: Add ABI to show msi_irqs of platform devices 2021-08-24 09:16:20 +02:00
platform.c driver core: platform: Remove platform_device_add_properties() 2021-08-18 16:08:11 +02:00
property.c device property: Allow error pointer to be passed to fwnode APIs 2022-06-09 10:22:47 +02:00
soc.c soc: fix comment for freeing soc_dev_attr 2020-12-09 19:46:31 +01:00
swnode.c software node: fix wrong node passed to find nargs_prop 2022-01-27 11:03:46 +01:00
syscore.c
topology.c topology: use bin_attribute to break the size limitation of cpumap ABI 2021-08-13 10:27:49 +02:00
trace.c devres: Enable trace events 2021-06-15 17:14:36 +02:00
trace.h devres: Enable trace events 2021-06-15 17:14:36 +02:00
transport_class.c