linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] only assign psmouse handlers on successful return from fsp_init()
@ 2011-12-28 20:11 Paul Fox
  2011-12-29  1:40 ` Tai-hwa Liang
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Fox @ 2011-12-28 20:11 UTC (permalink / raw)
  To: linux-input; +Cc: Dmitry Torokhov, Tai-hwa Liang

the psmouse action routines were being initialized before all
possible error conditions had been considered.  a subsequent
failure would leave these handlers set, and later touchpad
traffic or psmouse driver actions could cause them to be called,
even though fsp_init() had failed.

Signed-off-by: Paul Fox <pgf@laptop.org>

---
 drivers/input/mouse/sentelic.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c
index 2fc887a..3539ca6 100644
--- a/drivers/input/mouse/sentelic.c
+++ b/drivers/input/mouse/sentelic.c
@@ -842,12 +842,6 @@ int fsp_init(struct psmouse *psmouse)
 	__set_bit(REL_WHEEL, psmouse->dev->relbit);
 	__set_bit(REL_HWHEEL, psmouse->dev->relbit);
 
-	psmouse->protocol_handler = fsp_process_byte;
-	psmouse->disconnect = fsp_disconnect;
-	psmouse->reconnect = fsp_reconnect;
-	psmouse->cleanup = fsp_reset;
-	psmouse->pktsize = 4;
-
 	/* set default packet output based on number of buttons we found */
 	error = fsp_activate_protocol(psmouse);
 	if (error)
@@ -861,6 +855,12 @@ int fsp_init(struct psmouse *psmouse)
 		goto err_out;
 	}
 
+	psmouse->protocol_handler = fsp_process_byte;
+	psmouse->disconnect = fsp_disconnect;
+	psmouse->reconnect = fsp_reconnect;
+	psmouse->cleanup = fsp_reset;
+	psmouse->pktsize = 4;
+
 	return 0;
 
  err_out:
-- 
1.7.1



=---------------------
 paul fox, pgf@laptop.org

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

end of thread, other threads:[~2011-12-30 14:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-28 20:11 [PATCH] only assign psmouse handlers on successful return from fsp_init() Paul Fox
2011-12-29  1:40 ` Tai-hwa Liang
2011-12-30  8:23   ` Dmitry Torokhov
2011-12-30 10:36     ` Tai-hwa Liang
2011-12-30 14:46     ` Paul Fox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).