mirror-linux/drivers/base
Muchun Song 03a2cc1756 drivers/base/memory: fix memory block reference leak in poison accounting
memblk_nr_poison_inc() and memblk_nr_poison_sub() look up a memory block
via find_memory_block_by_id(), which acquires a reference to the memory
block device.

Both helpers use the returned memory block without dropping that
reference, leaking the device reference on each successful lookup.  Drop
the reference after updating nr_hwpoison.

Link: https://lore.kernel.org/20260428085219.1316047-3-songmuchun@bytedance.com
Fixes: 5033091de8 ("mm/hwpoison: introduce per-memory_block hwpoison counter")
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: Oscar Salvador <osalvador@suse.de>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Huang, Ying" <huang.ying.caritas@gmail.com>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-05-13 17:40:03 -07:00
..
firmware_loader Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
power thermal: core: Suspend thermal zones later and resume them earlier 2026-04-08 12:30:31 +02:00
regmap regmap: sdw-mbq: Fix spelling mistake "undeferable" -> "undeferrable" 2026-04-27 06:48:16 +09:00
test drivers: base: test: Add ...find_device_by...(... NULL) tests 2024-12-24 09:48:09 +01:00
Kconfig driver core: Make deferred_probe_timeout default a Kconfig option 2026-03-30 20:45:27 +02:00
Makefile Revert "revocable: Add Kunit test cases" 2026-02-06 16:08:48 +01:00
arch_numa.c arch_numa: Restore nid checks before registering a memblock with a node 2024-12-01 22:04:52 +02:00
arch_topology.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
attribute_container.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
auxiliary.c ACPI support updates for 7.1-rc1 2026-04-13 19:25:07 -07:00
auxiliary_sysfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
base.h driver core: make software nodes available earlier 2026-04-04 00:33:49 +02:00
bus.c driver core: generalize driver_override in struct device 2026-03-17 20:30:23 +01:00
cacheinfo.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
class.c kernfs: pass struct ns_common instead of const void * for namespace tags 2026-04-09 14:36:52 +02:00
component.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
container.c
core.c Driver core fixes for 7.1-rc1 2026-04-19 12:58:08 -07:00
cpu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dd.c Driver core fixes for 7.1-rc1 2026-04-19 12:58:08 -07:00
devcoredump.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
devres.c devres: rename and export set_node_dbginfo() 2026-03-18 00:02:59 +01:00
devtmpfs.c devtmpfs: Replace simple_strtoul with kstrtoint in mount_param 2026-01-16 16:44:43 +01:00
driver.c driver core: Introduce device_iter_t for device iterating APIs 2025-01-10 15:26:12 +01:00
faux.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
firmware.c
hypervisor.c
init.c driver core: make software nodes available earlier 2026-04-04 00:33:49 +02:00
isa.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
map.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
memory.c drivers/base/memory: fix memory block reference leak in poison accounting 2026-05-13 17:40:03 -07:00
module.c drivers: base: handle module_kobject creation 2025-04-16 15:10:55 +02:00
node.c mm: add gpu active/reclaim per-node stat counters (v2) 2026-04-08 06:52:47 +10:00
physical_location.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
physical_location.h
pinctrl.c driver core: make pinctrl_bind_pins() private 2026-01-19 00:34:44 +01:00
platform-msi.c platform-msi: Add msi_remove_device_irq_domain() in platform_device_msi_free_irqs_all() 2025-05-07 17:49:00 +02:00
platform.c Linux 7.0-rc5 2026-03-22 23:13:33 +01:00
property.c Driver core fixes for 7.1-rc1 2026-04-19 12:58:08 -07:00
soc.c base: soc: rename and export soc_device_get_machine() 2026-03-12 16:18:49 +01:00
swnode.c Driver core fixes for 7.1-rc1 2026-04-19 12:58:08 -07:00
syscore.c syscore: Pass context data to callbacks 2025-11-14 10:01:52 +01:00
topology.c sysfs: treewide: switch back to attribute_group::bin_attrs 2025-06-17 10:44:15 +02:00
trace.c
trace.h devres: Fix page faults when tracing devres from unloaded modules 2024-10-14 08:21:09 +02:00
transport_class.c SCSI misc on 20260212 2026-02-12 15:43:02 -08:00