Skip to content

Commit 185af4d

Browse files
committed
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>
1 parent 4db1f47 commit 185af4d

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

drivers/input/mouse/psmouse-base.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,16 +1536,9 @@ static int psmouse_reconnect(struct serio *serio)
15361536
{
15371537
struct psmouse *psmouse = serio_get_drvdata(serio);
15381538
struct psmouse *parent = NULL;
1539-
struct serio_driver *drv = serio->drv;
15401539
unsigned char type;
15411540
int rc = -1;
15421541

1543-
if (!drv || !psmouse) {
1544-
psmouse_dbg(psmouse,
1545-
"reconnect request, but serio is disconnected, ignoring...\n");
1546-
return -1;
1547-
}
1548-
15491542
mutex_lock(&psmouse_mutex);
15501543

15511544
if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {

0 commit comments

Comments
 (0)