Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp162804pxx; Wed, 28 Oct 2020 01:12:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUF8OdrunuMYBLhfKPA6Jo6beGN3ibRWkH7xoYewWvEKkkEY9L5ap2j80iM1nYOlaBsp3A X-Received: by 2002:a17:906:34c3:: with SMTP id h3mr6400807ejb.132.1603872762873; Wed, 28 Oct 2020 01:12:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603872762; cv=none; d=google.com; s=arc-20160816; b=FLjVnfFYQuXT0169r1c11Ph4bEAAFxpqB5ivuNbzBqRTv/nUWtPwJo/u0HLi30TGJP e3Klnc/doiWJxbGuG2zSxXUI4BPaPU7oMstfItzygOt83o6Q/CZZBKp1TCsHCgWmY9QZ wVpne9eUNSOZ9SNWGcPZLFN+y3PYsg8jqVjjoNUfdk9vkhdHlDxsEh5L6WuLZ+8Hq3RO JqpGh8kwp6gqpJxae+pD0VfhqNfch/EmN9/Md+5eFB/w2FCe5HfiZlqUvgDXMirMPZ43 1RntOVwx4svqWhFe7da/8HIqTFXvs+8OX5XZaBInbGRUZTi57AokHRDcNs7a3m4TtM5D L/jg== 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=mKbeovfzH+eO+dLV77PFk9smrjQ0HjgDf554pCAjBro=; b=RNqYAt+jiTziRAVfRY2dx5NsYIR9KkhwysD/A2hMFR7rMmVzMuuA3KrjU6+/NpfHO5 KTN19wC7o3FxaxPtErENYS9Psj5XszXenJeZZc4jylzPjeeSdsD4WnkPGnl1sduSQbqc PLCl+iixbMo6CaIdro0dSdW5a9Ac/1IixccqCNhZZ+t/soReximH+3zhaxEwPHYIx/Pd bqSD7P96A63wa0ojLL6TAdfnVMDXU0Xaqhq11ieH8iBDYKs+HsLa57L20q0DbaC6Qbo3 KEmANXm52k7M7YD1vr/aohHI1o9kg01h6Y+QOKzdMZp6oq/U9wpvdjzZmOPimK8Ikzkc 8/uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Mms6mL/Y"; 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 dk22si2709939edb.258.2020.10.28.01.12.20; Wed, 28 Oct 2020 01:12:42 -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="Mms6mL/Y"; 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 S1753040AbgJ0N7u (ORCPT + 99 others); Tue, 27 Oct 2020 09:59:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:47064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753276AbgJ0N7e (ORCPT ); Tue, 27 Oct 2020 09:59:34 -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 376762068D; Tue, 27 Oct 2020 13:59:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807173; bh=+9YvNaqV/PeAv7CGYG6pCsCh2rdY/O/DsEjmda1d3O8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mms6mL/YcjTSUCnP6XfflpRQZnP353hhDkJsjkMBpkUN2/Yjv/WatajYh2nN8s0zJ TM1DeqKRBawIBkHpDKxIGeDsRC8d7k3p4/aeA7NVdnSKm62umRBPrXoAGPPnRuDZos BL0kmu2LdtfVGuvq/m1bqC2I/TjWpt2Jlrf3OFik= 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 4.4 070/112] Input: omap4-keypad - fix handling of platform_get_irq() error Date: Tue, 27 Oct 2020 14:49:40 +0100 Message-Id: <20201027134903.874401689@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@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 3d2c60c8de830..c6a468dfdfb48 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -253,10 +253,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