ChangeSet 1.1608.84.4, 2004/03/10 16:05:28-08:00, chrisw@osdl.org [PATCH] class_simple cleanup in input Doesn't catch error on class_simple_add, and existing error return paths forget to class_simple_destroy. drivers/input/input.c | 4 ++++ 1 files changed, 4 insertions(+) diff -Nru a/drivers/input/input.c b/drivers/input/input.c --- a/drivers/input/input.c Mon Mar 15 15:29:55 2004 +++ b/drivers/input/input.c Mon Mar 15 15:29:55 2004 @@ -727,6 +727,8 @@ int retval = -ENOMEM; input_class = class_simple_create(THIS_MODULE, "input"); + if (IS_ERR(input_class)) + return PTR_ERR(input_class); input_proc_init(); retval = register_chrdev(INPUT_MAJOR, "input", &input_fops); if (retval) { @@ -734,6 +736,7 @@ remove_proc_entry("devices", proc_bus_input_dir); remove_proc_entry("handlers", proc_bus_input_dir); remove_proc_entry("input", proc_bus); + class_simple_destroy(input_class); return retval; } @@ -743,6 +746,7 @@ remove_proc_entry("handlers", proc_bus_input_dir); remove_proc_entry("input", proc_bus); unregister_chrdev(INPUT_MAJOR, "input"); + class_simple_destroy(input_class); } return retval; }