Browse Source

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>
Dmitry Torokhov 10 years ago
parent
commit
185af4d666
1 changed files with 0 additions and 7 deletions
  1. 0 7
      drivers/input/mouse/psmouse-base.c

+ 0 - 7
drivers/input/mouse/psmouse-base.c

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