aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2014-10-24 20:20:27 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-10-28 14:42:56 -0400
commit185af4d6668e4805d18d1bdf21dfec89d680fee3 (patch)
tree48b74b3bf021e6ef362d24b4b485aeda43a95b2f /drivers/input/mouse
parent4db1f47c29bd19e2069fb877620540db2a51a572 (diff)
Input: psmouse - remove unneeded check in psmouse_reconnect()
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>
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r--drivers/input/mouse/psmouse-base.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 26994f6a2b2a..95a3a6e2faf6 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -1536,16 +1536,9 @@ static int psmouse_reconnect(struct serio *serio)
1536{ 1536{
1537 struct psmouse *psmouse = serio_get_drvdata(serio); 1537 struct psmouse *psmouse = serio_get_drvdata(serio);
1538 struct psmouse *parent = NULL; 1538 struct psmouse *parent = NULL;
1539 struct serio_driver *drv = serio->drv;
1540 unsigned char type; 1539 unsigned char type;
1541 int rc = -1; 1540 int rc = -1;
1542 1541
1543 if (!drv || !psmouse) {
1544 psmouse_dbg(psmouse,
1545 "reconnect request, but serio is disconnected, ignoring...\n");
1546 return -1;
1547 }
1548
1549 mutex_lock(&psmouse_mutex); 1542 mutex_lock(&psmouse_mutex);
1550 1543
1551 if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) { 1544 if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {