projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ed3119e
)
iommu: Fix reference count leak in iommu_group_alloc.
author
Qiushi Wu
<wu000273@umn.edu>
Wed, 27 May 2020 21:00:19 +0000
(16:00 -0500)
committer
Joerg Roedel
<jroedel@suse.de>
Fri, 29 May 2020 13:27:50 +0000
(15:27 +0200)
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:
d72e31c93746
("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
patch
|
blob
|
history
diff --git
a/drivers/iommu/iommu.c
b/drivers/iommu/iommu.c
index
1faa08c
..
03d6a26
100644
(file)
--- a/
drivers/iommu/iommu.c
+++ b/
drivers/iommu/iommu.c
@@
-510,7
+510,7
@@
struct iommu_group *iommu_group_alloc(void)
NULL, "%d", group->id);
if (ret) {
ida_simple_remove(&iommu_group_ida, group->id);
- k
free(group
);
+ k
object_put(&group->kobj
);
return ERR_PTR(ret);
}