android_kernel_xiaomi_sm8350/drivers/misc/ocxl
Yang Yingliang 0cd0506237 misc: ocxl: fix possible name leak in ocxl_file_register_afu()
[ Upstream commit a4cb1004aeed2ab893a058fad00a5b41a12c4691 ]

If device_register() returns error in ocxl_file_register_afu(),
the name allocated by dev_set_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(),
and info is freed in info_release().

Fixes: 75ca758adb ("ocxl: Create a clear delineation between ocxl backend & frontend")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Andrew Donnellan <ajd@linux.ibm.com>
Acked-by: Frederic Barrat <fbarrat@linux.ibm.com>
Link: https://lore.kernel.org/r/20221111145929.2429271-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-01-18 11:41:23 +01:00
..
afu_irq.c
config.c
context.c
core.c
file.c misc: ocxl: fix possible name leak in ocxl_file_register_afu() 2023-01-18 11:41:23 +01:00
Kconfig
link.c
main.c
Makefile
mmio.c
ocxl_internal.h
pasid.c
pci.c
sysfs.c
trace.c
trace.h