Prev: [PATCH] forcedeth: Fix different hardware statistics versions.
Next: [PATCH 3/6] Driver core: Fix memory leak on class_register error path
From: Patrick Pannuto on 22 Jul 2010 18:20 This leak is the same as the bus path; kset->kobj.name is set, but kset_register fails, thus nothing will ever call kset_unregister and name will be leaked Signed-off-by: Patrick Pannuto <ppannuto(a)codeaurora.org> --- lib/kobject.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lib/kobject.c b/lib/kobject.c index f07c572..713b235 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -843,6 +843,7 @@ struct kset *kset_create_and_add(const char *name, return NULL; error = kset_register(kset); if (error) { + kfree(kset->kobj.name); kfree(kset); return NULL; } -- 1.7.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |