Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp286161pxx; Wed, 28 Oct 2020 05:03:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNFY5aZoPzio8iHiAj9jF/36EGsbAxnrWJyNWJsk0u2mg3Lsagsp9aFwjDnQsWWoBhPypg X-Received: by 2002:a05:6402:1148:: with SMTP id g8mr7564466edw.271.1603886615037; Wed, 28 Oct 2020 05:03:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603886615; cv=none; d=google.com; s=arc-20160816; b=mf8Tkn88yM4bAWCLWlTEiBy9GDoKbfkY2sV9soiFQrviGmAVX866A8sH4s5EEXhfOi CZ7lpXN+yijA+hxHpUk6Ga5cf7wEfiO4PC1C8hyK8ZMYsQu64mZ2qbkQz5xCWcsGJU3K Vl7ISBJAGOHwHAgXHNoe9wd7T1VnpiTxrs0dryBgxDGJ1Ns8YBzZCMPsuljwMNs/DtCy V3KA1dDujX9bGUWwZu84l1wX6m45h9kpD35vpup/8AusYnE6xamBmClk+RSiZ2teFRcF xVpQPK6sgCbZHMgbn0/Y6nL7Lcw61iC7DttOc+A1ITGF9ILCFI9eJ1dnA5CGv6gm2sKp 0iJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=b/J6x2nfjP00YxKx1qyUIImLctjcCSQ3jh5T/m4eNJo=; b=e3AxJO+rZTdSzTfisXCFxio3+/AzETQv/dY/rD5H4Zks189THW/Z/41ZpBW0r3/tQi qhfzDFkHFoA6rXLmW4qc9xFnZjHOdnbanKDeDINZCCLkpY/nVwRKNhgym3CUb3VPfJUJ 6UXVCYH1KERFpwVfke3fQla9o5ROrRdJB/bEFseRnV9BnINDji7SmkV3ZRdOpyUsZmYb E9mfgTyGcoOnA8JNhEKo3zfqaSHpBiz83MTJr4C12zls1PDXb2WfQouZ+OUBQ0UEqLEb MRXhVzVpJFc7BJc+2yjxqJOhYDa4PNmL8+ElGXIja5vAnKy9L7BcazQ6atcJQRCrw64l BPLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YcIWN6XG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si2795558ejd.147.2020.10.28.05.03.10; Wed, 28 Oct 2020 05:03:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YcIWN6XG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1795083AbgJ0PPD (ORCPT + 99 others); Tue, 27 Oct 2020 11:15:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:45034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1793994AbgJ0PJf (ORCPT ); Tue, 27 Oct 2020 11:09:35 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 30FDF206E5; Tue, 27 Oct 2020 15:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811374; bh=hg5dNERNp39E82siiRmg5UI3KvzKjddXU4Hf7fOLtG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YcIWN6XGQq9qUF1HGdnjaiIiaFeTSnw1llFC083qqUDV7Mi9RT21VlmSBWpwnqiGo qMQ9MQQRWBKVjRONIPBS8eVl3CRTKMYnCKE4pDTYWmiRy9rcWPvf4I5yw0f2gspdqg swcOOV2a8T1dZV96M/YqCv0Xzp2A7JGsOlZ+mXyk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Dmitry Torokhov , Sasha Levin Subject: [PATCH 5.8 470/633] Input: omap4-keypad - fix handling of platform_get_irq() error Date: Tue, 27 Oct 2020 14:53:33 +0100 Message-Id: <20201027135544.782951445@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Krzysztof Kozlowski [ Upstream commit 4738dd1992fa13acfbbd71800c71c612f466fa44 ] 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 Link: https://lore.kernel.org/r/20200828145744.3636-2-krzk@kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- 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 94c94d7f5155f..d6c924032aaa8 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) { -- 2.25.1