[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1279836546-26913-4-git-send-email-ppannuto@codeaurora.org>
Date: Thu, 22 Jul 2010 15:09:03 -0700
From: Patrick Pannuto <ppannuto@...eaurora.org>
To: linux-kernel@...r.kernel.org
Cc: ppannuto@...eaurora.org, Greg Kroah-Hartman <gregkh@...e.de>,
Andi Kleen <ak@...ux.intel.com>,
Stephen Hemminger <shemminger@...tta.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
"Hans J. Koch" <hjk@...utronix.de>
Subject: [PATCH 3/6] Driver core: Fix memory leak on class_register error path
This leak is the same as the bus path; cp's kobj name
is set, but kset_register fails, free'ing cp, but not
cp->class_subsys.kobj.name
Signed-off-by: Patrick Pannuto <ppannuto@...eaurora.org>
---
drivers/base/class.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 8e231d0..045acaf 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -197,6 +197,7 @@ int __class_register(struct class *cls, struct lock_class_key *key)
error = kset_register(&cp->class_subsys);
if (error) {
+ kfree(cp->class_subsys.kobj.name);
kfree(cp);
return error;
}
--
1.7.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists