From patchwork Thu Aug 27 07:24:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11740139 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D52F313B6 for ; Thu, 27 Aug 2020 07:24:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA00E22BF3 for ; Thu, 27 Aug 2020 07:24:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598513067; bh=S+YE0qEWx4yI9dTxKlN3BZj1KnlkIX5R53Okn/Sb7V4=; h=From:To:Subject:Date:List-ID:From; b=zDgzR7iOjM5zvMWzJH1l3xzActoc7cX7GfT+lhQ9HwCr2v9Mbkm/xxWlk4UsJ/UrD 0ThUVUxONg/c1kcdsFKEMI4S+a6XgXAm+SKi/AA7wXrdR1aYKSCbHJVlG+hfB1Rqm+ aWeETeCmJDNLLacxXFKleQ27GoICTxSuA6Cz6eeE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728033AbgH0HY0 (ORCPT ); Thu, 27 Aug 2020 03:24:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:32852 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726882AbgH0HY0 (ORCPT ); Thu, 27 Aug 2020 03:24:26 -0400 Received: from kozik-lap.mshome.net (unknown [194.230.155.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0F41522BEB; Thu, 27 Aug 2020 07:24:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598513066; bh=S+YE0qEWx4yI9dTxKlN3BZj1KnlkIX5R53Okn/Sb7V4=; h=From:To:Subject:Date:From; b=Yyeb8XSxy68hcCJQxaJsRg1IUQoyJjvaZlMhByINmUddmrCaijr2C6IUTIwID5BLG nr9ZMOkzwV+8NaaLBwtp2LxnKZ4rlrQBehoXrtGlQxmhyDDZl/Uh9NG3jjK6a5NgyW HKR3sDP8cjc7CfUshPIqcC0cw3WvOexe4GHeBX94= From: Krzysztof Kozlowski To: Dmitry Torokhov , Maxime Ripard , Chen-Yu Tsai , Krzysztof Kozlowski , H Hartley Sweeten , Sebastian Reichel , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/4] Input: ep93xx_keypad - Fix handling of platform_get_irq() error Date: Thu, 27 Aug 2020 09:24:17 +0200 Message-Id: <20200827072420.22848-1-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check. Fixes: 60214f058f44 ("Input: ep93xx_keypad - update driver to new core support") Signed-off-by: Krzysztof Kozlowski --- drivers/input/keyboard/ep93xx_keypad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c index 7c70492d9d6b..f831f01501d5 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c @@ -250,8 +250,8 @@ static int ep93xx_keypad_probe(struct platform_device *pdev) } keypad->irq = platform_get_irq(pdev, 0); - if (!keypad->irq) { - err = -ENXIO; + if (keypad->irq < 0) { + err = keypad->irq; goto failed_free; }