]> git.baikalelectronics.ru Git - kernel.git/commit
iommu: Fix reference count leak in iommu_group_alloc.
authorQiushi Wu <wu000273@umn.edu>
Wed, 27 May 2020 21:00:19 +0000 (16:00 -0500)
committerJoerg Roedel <jroedel@suse.de>
Fri, 29 May 2020 13:27:50 +0000 (15:27 +0200)
commit9a478371b8f8dc9d32860517361075af27d9187d
treec31d4380cd1288528d51702675b51cc657b24797
parent2cf526996ea754936bc6a1c7146e9b32b4df11f2
iommu: Fix reference count leak in iommu_group_alloc.

kobject_init_and_add() takes reference even when it fails.
Thus, when kobject_init_and_add() returns an error,
kobject_put() must be called to properly clean up the kobject.

Fixes: a2a3060edfdd ("iommu: IOMMU Groups")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Link: https://lore.kernel.org/r/20200527210020.6522-1-wu000273@umn.edu
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c