public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device
@ 2007-10-29  6:51 Dirk Hohndel
  2007-10-29  7:53 ` Jeff Garzik
  0 siblings, 1 reply; 14+ messages in thread
From: Dirk Hohndel @ 2007-10-29  6:51 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, linux-kernel

[INPUT] hidinput_connect incorrectly ignored return value from input_register_device

Signed-off-by: Dirk Hohndel <hohndel@linux.intel.com>

---
 drivers/hid/hid-input.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index dd332f2..c8640e7 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1186,13 +1186,19 @@ int hidinput_connect(struct hid_device *hid)
 				 * UGCI) cram a lot of unrelated inputs into the
 				 * same interface. */
 				hidinput->report = report;
-				input_register_device(hidinput->input);
+				if (input_register_device(hidinput->input)) {
+					input_free_device(hidinput->input);
+					return -1;
+				}
 				hidinput = NULL;
 			}
 		}
 
 	if (hidinput)
-		input_register_device(hidinput->input);
+		if (input_register_device(hidinput->input)) {
+			input_free_device(hidinput->input);
+			return -1;
+		}
 
 	return 0;
 }
-- 
gitgui.0.8.4.g8d863


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

end of thread, other threads:[~2007-10-29 23:01 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-29  6:51 [PATCH] INPUT: fix hidinput_connect ignoring retval from input_register_device Dirk Hohndel
2007-10-29  7:53 ` Jeff Garzik
2007-10-29  8:49   ` Dirk Hohndel
2007-10-29  9:35     ` Jeff Garzik
2007-10-29 10:14     ` Jiri Kosina
2007-10-29 12:54       ` Dmitry Torokhov
2007-10-29 12:57         ` Jiri Kosina
2007-10-29 14:49         ` Jeff Garzik
2007-10-29 15:20           ` Dirk Hohndel
2007-10-29 15:33             ` Dmitry Torokhov
2007-10-29 15:38               ` Hohndel, Dirk
2007-10-29 17:11                 ` Dmitry Torokhov
2007-10-29 17:28             ` Jiri Kosina
2007-10-29 22:50               ` Dirk Hohndel

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