Skip to content

Commit

Permalink
Input: omap4-keypad - fix handling of platform_get_irq() error
Browse files Browse the repository at this point in the history
[ Upstream commit 4738dd1 ]

platform_get_irq() returns -ERRNO on error.  In such case comparison
to 0 would pass the check.

Fixes: f3a1ba6 ("Input: omap4-keypad - use platform device helpers")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200828145744.3636-2-krzk@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
krzk authored and gregkh committed Oct 29, 2020
1 parent d96fc37 commit 86f11d5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/input/keyboard/omap4-keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,8 @@ static int omap4_keypad_probe(struct platform_device *pdev)
}

irq = platform_get_irq(pdev, 0);
if (!irq) {
dev_err(&pdev->dev, "no keyboard irq assigned\n");
return -EINVAL;
}
if (irq < 0)
return irq;

keypad_data = kzalloc(sizeof(struct omap4_keypad), GFP_KERNEL);
if (!keypad_data) {
Expand Down

0 comments on commit 86f11d5

Please sign in to comment.