projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bfc5c17
)
kobject: fix kset sample error path
author
Bjorn Helgaas
<bhelgaas@google.com>
Tue, 8 Oct 2013 20:20:24 +0000
(14:20 -0600)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Tue, 3 Dec 2013 18:13:30 +0000
(10:13 -0800)
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@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
samples/kobject/kset-example.c
patch
|
blob
|
history
diff --git
a/samples/kobject/kset-example.c
b/samples/kobject/kset-example.c
index d0c687fd9802220bd558303f54ccd683e77a3803..5dce351f131f8c154048124bc1bf3a6a32cb32c7 100644
(file)
--- 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;
}