linux-stable/drivers
Christophe JAILLET f47f758cff drivers/base/memory: fix an unlikely reference counting issue in __add_memory_block()
__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>
2022-04-28 23:16:19 -07:00
..
accessibility
acpi Revert "ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40" 2022-04-21 19:58:14 +02:00
amba
android
ata ata: pata_marvell: Check the 'bmdma_addr' beforing reading 2022-04-22 08:45:06 +09:00
atm
auxdisplay
base drivers/base/memory: fix an unlikely reference counting issue in __add_memory_block() 2022-04-28 23:16:19 -07:00
bcma
block floppy: disable FDRAWCMD by default 2022-04-27 09:41:54 -07:00
bluetooth
bus
cdrom
char random: use memmove instead of memcpy for remaining 32 bytes 2022-04-16 12:53:31 +02:00
clk
clocksource
comedi
connector
counter
cpufreq cpufreq: qcom-cpufreq-hw: Clear dcvs interrupts 2022-04-26 12:08:31 +05:30
cpuidle cpuidle: riscv: support non-SMP config 2022-04-19 17:42:08 -07:00
crypto
cxl cxl/pci: Drop shadowed variable 2022-04-08 12:59:43 -07:00
dax
dca
devfreq
dio
dma dmaengine: idxd: skip clearing device context when device is read-only 2022-04-20 17:24:43 +05:30
dma-buf
edac EDAC/synopsys: Read the error count from the correct register 2022-04-14 14:44:49 +02:00
eisa
extcon
firewire
firmware sound fixes for 5.18-rc4 2022-04-22 13:11:38 -07:00
fpga
fsi
gnss
gpio gpio: Request interrupts after IRQ is initialized 2022-04-22 13:59:19 -07:00
gpu Merge tag 'amd-drm-fixes-5.18-2022-04-27' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes 2022-04-29 10:27:05 +10:00
greybus
hid
hsi
hv hyperv-fixes for 5.18-rc2 2022-04-07 06:35:34 -10:00
hwmon
hwspinlock
hwtracing
i2c i2c: ismt: Fix undefined behavior due to shift overflowing the constant 2022-04-15 23:49:02 +02:00
i3c
idle intel_idle: Fix SPR C6 optimization 2022-04-27 20:36:47 +02:00
iio
infiniband RDMA/hfi1: Fix use-after-free bug for mm struct 2022-04-08 15:40:06 -03:00
input Input updates for v5.18-rc3 2022-04-23 09:52:07 -07:00
interconnect
iommu iommu/omap: Fix regression in probe for NULL pointer dereference 2022-04-08 11:16:29 +02:00
ipack
irqchip
isdn
leds
macintosh
mailbox
mcb
md block-5.18-2022-04-22 2022-04-23 09:46:44 -07:00
media media: si2157: unknown chip version Si2147-A30 ROM 0x50 2022-04-09 17:45:49 +02:00
memory
memstick
message scsi: message: fusion: Remove redundant variable dmp 2022-04-06 22:28:07 -04:00
mfd
misc
mmc mmc: core: improve API to make clear mmc_hw_reset is for cards 2022-04-08 11:00:08 +02:00
most
mtd mtd: rawnand: qcom: fix memory corruption that causes panic 2022-04-21 09:29:07 +02:00
mux
net Revert "ibmvnic: Add ethtool private flag for driver-defined queue limits" 2022-04-28 09:46:18 -07:00
nfc
ntb
nubus
nvdimm
nvme nvme-pci: disable namespace identifiers for Qemu controllers 2022-04-15 06:56:17 +02:00
nvmem
of
opp
parisc
parport
pci hyperv-fixes for 5.18-rc2 2022-04-07 06:35:34 -10:00
pcmcia
peci
perf arm_pmu: Validate single/group leader events 2022-04-13 11:48:45 +01:00
phy
pinctrl pinctrl: pistachio: fix use of irq_of_parse_and_map() 2022-04-24 16:24:09 +02:00
platform platform/x86/intel: pmc/core: change pmc_lpm_modes to static 2022-04-27 16:55:54 +02:00
pnp
power power: supply: Reset err after not finding static battery 2022-04-13 12:05:22 +02:00
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi scsi: sr: Do not leak information in ioctl 2022-04-18 22:48:31 -04:00
sh
siox
slimbus
soc
soundwire
spi spi: Fixes for v5.18 2022-04-19 10:30:43 -07:00
spmi
ssb
staging
target
tc
tee
thermal Merge branch 'thermal-int340x' 2022-04-28 16:51:24 +02:00
thunderbolt
tty
uio
usb
vdpa
vfio vfio/pci: Fix vf_token mechanism when device-specific VF drivers are used 2022-04-13 11:37:44 -06:00
vhost
video fbdev fixes and updates for kernel v5.18-rc5 2022-04-26 11:32:01 -07:00
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen xen: Convert kmap() to kmap_local_page() 2022-04-20 15:22:18 -05:00
zorro
Kconfig
Makefile