[PATCH] only assign psmouse handlers on successful return from fsp_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

---
 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@xxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux