WSL2-Linux-Kernel/drivers/hv
Yang Yingliang 448b627370 Drivers: hv: vmbus: fix possible memory leak in vmbus_device_register()
[ Upstream commit 25c94b0515 ]

If device_register() returns error in vmbus_device_register(),
the name allocated by dev_set_name() must 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: 09d50ff8a2 ("Staging: hv: make the Hyper-V virtual bus code build")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20221119081135.1564691-3-yangyingliang@huawei.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-02 17:41:05 +01:00
..
Kconfig hv: utils: add PTP_1588_CLOCK to Kconfig to fix build 2022-04-08 14:22:46 +02:00
Makefile Drivers: hv: Move Hyper-V extended capability check to arch neutral code 2021-06-05 10:22:34 +00:00
channel.c Drivers: hv: vmbus: Fix handling of messages with transaction ID of zero 2022-06-09 10:23:07 +02:00
channel_mgmt.c Drivers: hv: vmbus: fix double free in the error path of vmbus_add_channel_work() 2022-12-02 17:41:05 +01:00
connection.c drivers: hv: Fix missing error code in vmbus_connect() 2021-06-02 15:16:36 +00:00
hv.c drivers: hv: Create a consistent pattern for checking Hyper-V hypercall status 2021-04-21 09:49:19 +00:00
hv_balloon.c Drivers: hv: balloon: Support status report for larger page sizes 2022-09-05 10:30:04 +02:00
hv_common.c drivers: hv: Decouple Hyper-V clock/timer code from VMbus drivers 2021-07-19 09:24:28 +00:00
hv_debugfs.c hv_debugfs: Make hv_debug_root static 2020-04-04 17:47:43 +01:00
hv_fcopy.c Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer 2021-05-14 17:37:46 +00:00
hv_kvp.c Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer 2021-05-14 17:37:46 +00:00
hv_snapshot.c hv_utils: Set the maximum packet size for VSS driver to the length of the receive buffer 2021-08-25 19:03:20 +00:00
hv_trace.c hv: add SPDX license to trace 2018-03-28 13:24:56 +02:00
hv_trace.h Drivers: hv: vmbus: Drivers: hv: vmbus: Introduce CHANNELMSG_MODIFYCHANNEL_RESPONSE 2021-04-18 13:03:11 +00:00
hv_trace_balloon.h hv_balloon: trace post_status 2018-03-06 09:57:17 -08:00
hv_util.c drivers: hv: Decouple Hyper-V clock/timer code from VMbus drivers 2021-07-19 09:24:28 +00:00
hv_utils_transport.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 280 2019-06-05 17:36:36 +02:00
hv_utils_transport.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 280 2019-06-05 17:36:36 +02:00
hyperv_vmbus.h hyperv/vmbus: include linux/bitops.h 2021-10-22 19:16:08 +00:00
ring_buffer.c Drivers: hv: vmbus: Prevent load re-ordering when reading ring buffer 2022-04-20 09:34:15 +02:00
vmbus_drv.c Drivers: hv: vmbus: fix possible memory leak in vmbus_device_register() 2022-12-02 17:41:05 +01:00