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@xxxxxxxxxx> --- 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-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html