]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Input: psmouse - remove unneeded check in psmouse_reconnect()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 25 Oct 2014 00:20:27 +0000 (17:20 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 28 Oct 2014 18:42:56 +0000 (11:42 -0700)
psmouse_reconnect() will not be called if psmouse driver is not bound to
the serio port, so there is no point in checking that.  Also, as coded, it
introduces potential NULL dereference in psmouse_dbg() in case psmouse is
indeed NULL. Let's just remove it.

Detected by Coverity: CID 146528

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/mouse/psmouse-base.c

index 26994f6a2b2ae7abe3f04a953eab9004b25d40d1..95a3a6e2faf6f29aef187485a0c832f6595121ff 100644 (file)
@@ -1536,16 +1536,9 @@ static int psmouse_reconnect(struct serio *serio)
 {
        struct psmouse *psmouse = serio_get_drvdata(serio);
        struct psmouse *parent = NULL;
-       struct serio_driver *drv = serio->drv;
        unsigned char type;
        int rc = -1;
 
-       if (!drv || !psmouse) {
-               psmouse_dbg(psmouse,
-                           "reconnect request, but serio is disconnected, ignoring...\n");
-               return -1;
-       }
-
        mutex_lock(&psmouse_mutex);
 
        if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {