Skip to content

Commit de3748f

Browse files
elfringdtor
authored andcommitted
Input: adi - remove an unnecessary check
The input_free_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 2b2f514 commit de3748f

File tree

1 file changed

+1
-2
lines changed
  • drivers/input/joystick

1 file changed

+1
-2
lines changed

drivers/input/joystick/adi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,7 @@ static int adi_connect(struct gameport *gameport, struct gameport_driver *drv)
535535
}
536536
}
537537
fail2: for (i = 0; i < 2; i++)
538-
if (port->adi[i].dev)
539-
input_free_device(port->adi[i].dev);
538+
input_free_device(port->adi[i].dev);
540539
gameport_close(gameport);
541540
fail1: gameport_set_drvdata(gameport, NULL);
542541
kfree(port);

0 commit comments

Comments
 (0)