Skip to content

Commit

Permalink
Input: tca6416-keypad - fix interrupt enable disbalance
Browse files Browse the repository at this point in the history
[ Upstream commit cc141c3 ]

The driver has been switched to use IRQF_NO_AUTOEN, but in the error
unwinding and remove paths calls to enable_irq() were left in place, which
will lead to an incorrect enable counter value.

Fixes: bcd9730 ("Input: move to use request_irq by IRQF_NO_AUTOEN flag")
Link: https://lore.kernel.org/r/20230724053024.352054-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
dtor authored and gregkh committed Sep 19, 2023
1 parent e1c2e3c commit 52385cf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/input/keyboard/tca6416-keypad.c
Expand Up @@ -292,10 +292,8 @@ static int tca6416_keypad_probe(struct i2c_client *client)
return 0;

fail2:
if (!chip->use_polling) {
if (!chip->use_polling)
free_irq(client->irq, chip);
enable_irq(client->irq);
}
fail1:
input_free_device(input);
kfree(chip);
Expand All @@ -306,10 +304,8 @@ static void tca6416_keypad_remove(struct i2c_client *client)
{
struct tca6416_keypad_chip *chip = i2c_get_clientdata(client);

if (!chip->use_polling) {
if (!chip->use_polling)
free_irq(client->irq, chip);
enable_irq(client->irq);
}

input_unregister_device(chip->input);
kfree(chip);
Expand Down

0 comments on commit 52385cf

Please sign in to comment.