[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131008202024.19377.25396.stgit@bhelgaas-glaptop.roam.corp.google.com>
Date: Tue, 08 Oct 2013 14:20:24 -0600
From: Bjorn Helgaas <bhelgaas@...gle.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Veaceslav Falico <vfalico@...hat.com>,
Russell King <linux@....linux.org.uk>,
Neil Horman <nhorman@...driver.com>, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, Zdenek Kabelac <zkabelac@...hat.com>
Subject: [PATCH 2/2] kobject: fix kset sample error path
Previously, example_init() leaked a kset if any of the object creations
failed. This fixes the leak by calling kset_unregister() in the error
path.
Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
---
samples/kobject/kset-example.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c
index d0c687f..5dce351 100644
--- a/samples/kobject/kset-example.c
+++ b/samples/kobject/kset-example.c
@@ -262,6 +262,7 @@ baz_error:
bar_error:
destroy_foo_obj(foo_obj);
foo_error:
+ kset_unregister(example_kset);
return -EINVAL;
}
--
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