WSL2-Linux-Kernel/drivers/xen
Yang Yingliang c08c13cb13 xen/pcpu: fix possible memory leak in register_pcpu()
[ Upstream commit da36a2a76b ]

In device_add(), dev_set_name() is called to allocate name, if it returns
error, the name need be freed. As comment of device_register() says, it
should use put_device() to give up the reference in the error path. So fix
this by calling put_device(), then the name can be freed in kobject_cleanup().

Fixes: f65c9bb3fb ("xen/pcpu: Xen physical cpus online/offline sys interface")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20221110152441.401630-1-yangyingliang@huawei.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-26 09:24:40 +01:00
..
events
xen-pciback
xenbus
xenfs
Kconfig
Makefile
acpi.c
arm-device.c
balloon.c
biomerge.c
cpu_hotplug.c
dbgp.c
efi.c
evtchn.c
features.c
gntalloc.c
gntdev-common.h xen/gntdev: Accommodate VMA splitting 2022-10-26 12:34:24 +02:00
gntdev-dmabuf.c
gntdev-dmabuf.h
gntdev.c xen/gntdev: Accommodate VMA splitting 2022-10-26 12:34:24 +02:00
grant-table.c
manage.c
mcelog.c
mem-reservation.c
pci.c
pcpu.c xen/pcpu: fix possible memory leak in register_pcpu() 2022-11-26 09:24:40 +01:00
platform-pci.c
privcmd-buf.c
privcmd.c
privcmd.h
pvcalls-back.c
pvcalls-front.c
pvcalls-front.h
swiotlb-xen.c
sys-hypervisor.c
time.c
unpopulated-alloc.c
xen-acpi-pad.c
xen-acpi-processor.c
xen-balloon.c
xen-front-pgdir-shbuf.c
xen-scsiback.c
xlate_mmu.c