Skip to content

Commit 81cd7e8

Browse files
Chen Jundtor
authored andcommitted
Input: i8042 - fix leaking of platform device on module removal
Avoid resetting the module-wide i8042_platform_device pointer in i8042_probe() or i8042_remove(), so that the device can be properly destroyed by i8042_exit() on module unload. Fixes: 9222ba6 ("Input: i8042 - add deferred probe support") Signed-off-by: Chen Jun <chenjun102@huawei.com> Link: https://lore.kernel.org/r/20221109034148.23821-1-chenjun102@huawei.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 26c263b commit 81cd7e8

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/input/serio/i8042.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,8 +1543,6 @@ static int i8042_probe(struct platform_device *dev)
15431543
{
15441544
int error;
15451545

1546-
i8042_platform_device = dev;
1547-
15481546
if (i8042_reset == I8042_RESET_ALWAYS) {
15491547
error = i8042_controller_selftest();
15501548
if (error)
@@ -1582,7 +1580,6 @@ static int i8042_probe(struct platform_device *dev)
15821580
i8042_free_aux_ports(); /* in case KBD failed but AUX not */
15831581
i8042_free_irqs();
15841582
i8042_controller_reset(false);
1585-
i8042_platform_device = NULL;
15861583

15871584
return error;
15881585
}
@@ -1592,7 +1589,6 @@ static int i8042_remove(struct platform_device *dev)
15921589
i8042_unregister_ports();
15931590
i8042_free_irqs();
15941591
i8042_controller_reset(false);
1595-
i8042_platform_device = NULL;
15961592

15971593
return 0;
15981594
}

0 commit comments

Comments
 (0)