Input: sentelic - release mutex upon register write failure
authorTai-hwa Liang <avatar@sentelic.com>
Fri, 23 Dec 2011 09:14:31 +0000 (01:14 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 23 Dec 2011 09:15:31 +0000 (01:15 -0800)
Make sure that mutex is released upon register writing failure.
This fixes boot freezing observed on ARM based OLPC
(http://dev.laptop.org/ticket/11357).

Signed-off-by: Paul Fox <pgf@laptop.org>
Signed-off-by: Tai-hwa Liang <avatar@sentelic.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/mouse/sentelic.c

index c5b12d2e955a5cdb8c968c3e31d86bcb99e416b3..a2c15e9a8e79a68c517f2a33c985190b329f2366 100644 (file)
@@ -162,7 +162,7 @@ static int fsp_reg_write(struct psmouse *psmouse, int reg_addr, int reg_val)
        ps2_sendbyte(ps2dev, v, FSP_CMD_TIMEOUT2);
 
        if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0)
-               return -1;
+               goto out;
 
        if ((v = fsp_test_invert_cmd(reg_val)) != reg_val) {
                /* inversion is required */
@@ -261,7 +261,7 @@ static int fsp_page_reg_write(struct psmouse *psmouse, int reg_val)
        ps2_sendbyte(ps2dev, 0x88, FSP_CMD_TIMEOUT2);
 
        if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0)
-               return -1;
+               goto out;
 
        if ((v = fsp_test_invert_cmd(reg_val)) != reg_val) {
                ps2_sendbyte(ps2dev, 0x47, FSP_CMD_TIMEOUT2);