From patchwork Thu Aug 27 07:24:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11740141 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 21AB1722 for ; Thu, 27 Aug 2020 07:24:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0352822BF3 for ; Thu, 27 Aug 2020 07:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598513075; bh=BAre5Tw2oDhiNLdO1XwfLZXiLzknbF3rmthL41mUOJU=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=pCZ3S6V8vNfvh2W0K1UjDJzVvG8cHH+ZyJ6x8/GYVA8NJ/d95hifBofFNRlO6AbH+ PRwDMrdPnhX8F1YTlTfRkiOnKfnBRbqPkMjfjwSFH+mrsMIz14ElZkwm5x0AXJuIcP jvgmstKYhBU4bZYAv82cveY9xg6wi0OAzmDIrT6I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728081AbgH0HYe (ORCPT ); Thu, 27 Aug 2020 03:24:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:32960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726882AbgH0HY3 (ORCPT ); Thu, 27 Aug 2020 03:24:29 -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 8E4BE22CB2; Thu, 27 Aug 2020 07:24:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598513068; bh=BAre5Tw2oDhiNLdO1XwfLZXiLzknbF3rmthL41mUOJU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oYzjjtiseQtNWnGGOsgK7YAtZMOolN4ZF0lL9tr+mMeNr85khRXUPx3eoPJA+Z0d+ eREGXEEqk6f/GmjNkcpudOunQ8CmaRaJQTiULu0VmbQz9zpIBNeO2ntVtHofsqiVoI oC/t4BnDwVDunWSZFGgoA8dwE643pv3dgbm9wRhs= 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 2/4] Input: omap4-keypad - Fix handling of platform_get_irq() error Date: Thu, 27 Aug 2020 09:24:18 +0200 Message-Id: <20200827072420.22848-2-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827072420.22848-1-krzk@kernel.org> References: <20200827072420.22848-1-krzk@kernel.org> 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: f3a1ba60dbdb ("Input: omap4-keypad - use platform device helpers") Signed-off-by: Krzysztof Kozlowski --- drivers/input/keyboard/omap4-keypad.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index 94c94d7f5155..b075f1af0305 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -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) {