linux-stable/drivers/hv
Miaoqian Lin c377e2ba78 Drivers: hv: vmbus: Fix memory leak in vmbus_add_channel_kobj
[ Upstream commit 8bc69f8632 ]

kobject_init_and_add() takes reference even when it fails.
According to the doc of kobject_init_and_add():

   If this function returns an error, kobject_put() must be called to
   properly clean up the memory associated with the object.

Fix memory leak by calling kobject_put().

Fixes: c2e5df616e ("vmbus: add per-channel sysfs info")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Juan Vazquez <juvazq@linux.microsoft.com>
Link: https://lore.kernel.org/r/20220203173008.43480-1-linmq006@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-02-23 12:03:16 +01:00
..
channel.c scsi: storvsc: Use blk_mq_unique_tag() to generate requestIDs 2021-05-14 17:39:32 +00:00
channel_mgmt.c Drivers: hv: vmbus: Fix duplicate CPU assignments within a device 2021-07-19 09:26:31 +00: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: account for vmbus packet header in max_pkt_size 2022-02-01 17:27:11 +01: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
Kconfig Drivers: hv: Enable Hyper-V code to be built on ARM64 2021-08-04 16:55:21 +00:00
Makefile Drivers: hv: Move Hyper-V extended capability check to arch neutral code 2021-06-05 10:22:34 +00:00
ring_buffer.c Drivers: hv: vmbus: Fix kernel crash upon unbinding a device from uio_hv_generic driver 2021-09-03 11:00:06 +00:00
vmbus_drv.c Drivers: hv: vmbus: Fix memory leak in vmbus_add_channel_kobj 2022-02-23 12:03:16 +01:00