kernel-fxtec-pro1x/drivers/vfio/mdev
Qiushi Wu 1a98e4ef32 vfio/mdev: Fix reference count leak in add_mdev_supported_type
[ Upstream commit aa8ba13cae3134b8ef1c1b6879f66372531da738 ]

kobject_init_and_add() takes reference even when it fails.
If this function returns an error, kobject_put() must be called to
properly clean up the memory associated with the object. Thus,
replace kfree() by kobject_put() to fix this issue. Previous
commit "b8eb718348b8" fixed a similar problem.

Fixes: 7b96953bc6 ("vfio: Mediated device Core driver")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-25 15:33:01 +02:00
..
Kconfig
Makefile
mdev_core.c
mdev_driver.c
mdev_private.h
mdev_sysfs.c vfio/mdev: Fix reference count leak in add_mdev_supported_type 2020-06-25 15:33:01 +02:00
vfio_mdev.c