OrangePi_CM5/drivers/hv
Yang Yingliang 8dca384970 Drivers: hv: vmbus: fix possible memory leak in vmbus_device_register()
[ Upstream commit 25c94b051592c010abe92c85b0485f1faedc83f3 ]

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:40:00 +01:00
..
Kconfig Revert "hv: utils: add PTP_1588_CLOCK to Kconfig to fix build" 2022-04-13 21:01:03 +02:00
Makefile
channel.c Drivers: hv: vmbus: Use after free in __vmbus_open() 2021-05-14 09:50:20 +02:00
channel_mgmt.c Drivers: hv: vmbus: fix double free in the error path of vmbus_add_channel_work() 2022-12-02 17:40:00 +01:00
connection.c drivers: hv: Fix missing error code in vmbus_connect() 2021-07-14 16:55:59 +02:00
hv.c hyperv-fixes for 5.10-rc5 2020-11-16 15:02:33 -08:00
hv_balloon.c hv_balloon: rate-limit "Unhandled message" warning 2022-04-08 14:40:19 +02:00
hv_debugfs.c
hv_fcopy.c
hv_kvp.c
hv_snapshot.c
hv_trace.c
hv_trace.h
hv_trace_balloon.h
hv_util.c hv_utils: Fix passing zero to 'PTR_ERR' warning 2021-07-14 16:55:57 +02:00
hv_utils_transport.c
hv_utils_transport.h
hyperv_vmbus.h hyperv/vmbus: include linux/bitops.h 2021-11-18 14:03:42 +01:00
ring_buffer.c Drivers: hv: vmbus: Prevent load re-ordering when reading ring buffer 2022-04-20 09:23:20 +02:00
vmbus_drv.c Drivers: hv: vmbus: fix possible memory leak in vmbus_device_register() 2022-12-02 17:40:00 +01:00