public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] class_simple cleanup in input
@ 2004-03-04  4:01 Chris Wright
  2004-03-11  1:29 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Wright @ 2004-03-04  4:01 UTC (permalink / raw)
  To: greg; +Cc: linux-kernel

Doesn't catch error on class_simple_add, and existing error return paths
forget to class_simple_destroy.

===== drivers/input/input.c 1.42 vs edited =====
--- 1.42/drivers/input/input.c	Thu Jan 15 03:05:57 2004
+++ edited/drivers/input/input.c	Wed Mar  3 19:46:20 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;
 }


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] class_simple cleanup in input
  2004-03-04  4:01 [PATCH] class_simple cleanup in input Chris Wright
@ 2004-03-11  1:29 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2004-03-11  1:29 UTC (permalink / raw)
  To: Chris Wright; +Cc: linux-kernel

On Wed, Mar 03, 2004 at 08:01:46PM -0800, Chris Wright wrote:
> Doesn't catch error on class_simple_add, and existing error return paths
> forget to class_simple_destroy.

Applied, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-11  1:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-04  4:01 [PATCH] class_simple cleanup in input Chris Wright
2004-03-11  1:29 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox