linux/drivers/hv
Miaoqian Lin 91d8866ca5 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:01:04 +01:00
..
channel_mgmt.c Drivers: hv: vmbus: Increase wait time for VMbus unload 2021-05-14 09:50:21 +02:00
channel.c Drivers: hv: vmbus: Use after free in __vmbus_open() 2021-05-14 09:50:20 +02:00
connection.c drivers: hv: Fix missing error code in vmbus_connect() 2021-07-14 16:55:59 +02:00
hv_balloon.c hyperv-fixes for 5.10-rc3 2020-11-05 11:32:03 -08:00
hv_debugfs.c
hv_fcopy.c
hv_kvp.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
hv_snapshot.c
hv_trace_balloon.h
hv_trace.c
hv_trace.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
hv.c hyperv-fixes for 5.10-rc5 2020-11-16 15:02:33 -08:00
hyperv_vmbus.h hyperv/vmbus: include linux/bitops.h 2021-11-18 14:03:42 +01:00
Kconfig
Makefile
ring_buffer.c
vmbus_drv.c Drivers: hv: vmbus: Fix memory leak in vmbus_add_channel_kobj 2022-02-23 12:01:04 +01:00