[PATCH 1/1] UBUNTU: SAUCE: Revert "mm/slub: fix a memory leak in sysfs_slab_add()"

Kleber Sacilotto de Souza kleber.souza at canonical.com
Thu Sep 10 10:04:06 UTC 2020

BugLink: https://bugs.launchpad.net/bugs/1895109

This reverts commit 8d392dd31bd9205986b442528014c6eec3851491 (commit
dde3c6b72a16c2db826f54b2d49bdea26c3534a2 upstream).

It has been found that linux 5.4.0-45 introduced a regression that is
causing oops when starting LVM snapshots (LP #1894780). A fix for this
issue hasn't been found yet, but reverting dde3c6b72a16 "mm/slub: fix a
memory leak in sysfs_slab_add()" at least doesn't crash one of the
affected systems anymore.

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza at canonical.com>
 mm/slub.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 709e31002504..434e4c6aca80 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -5804,10 +5804,8 @@ static int sysfs_slab_add(struct kmem_cache *s)
 	s->kobj.kset = kset;
 	err = kobject_init_and_add(&s->kobj, &slab_ktype, NULL, "%s", name);
-	if (err) {
-		kobject_put(&s->kobj);
+	if (err)
 		goto out;
-	}
 	err = sysfs_create_group(&s->kobj, &slab_attr_group);
 	if (err)

More information about the kernel-team mailing list