Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp189177pxx; Wed, 28 Oct 2020 02:10:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiBKN2uMauAO1p0g3oWYYRr7wUiOSEtrVx8xEbPnWNiVcWiYsqlUcm78DgDilsVbCENbyD X-Received: by 2002:a50:d88c:: with SMTP id p12mr6377442edj.352.1603876230246; Wed, 28 Oct 2020 02:10:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603876230; cv=none; d=google.com; s=arc-20160816; b=wyw85955K2/wUOXFNSQCb32zlqGMFwzPJl1lrR9HcBA+dKI5eYfbNtADtOBwLqwOc6 i9FX7CNPjmrEOlZWhZ0efiLVRqkx5YhuhF+8Y6EWFBjkKT9U3sckURF8o7RJ5Uvb6r09 m4OLlvaOb9aMmvRMijo/VgNrd6WwGfrNem7zeDllAUcoXN9yISPSITtzCFN2AlUZ8/Um wqi4SJ+k6JLi38dYCwuojDC9ORmcTBRQiel55TNI8ZPE2lad3YuthBLiistZpsX15MVv WPyeIrdST8Z5kV5oZcruNtmwY30iOrde9YunHWtJeiYkRnKba49BCI1No8s0jmNeqwht MNMw== 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=w1DHpRdv8MX7S+KGGD7n6/CFHlumzpX1KzWIxfNrCQs=; b=z2xPXKEKKmkz10KntHjHhmL8WwmP/sQru34No5lmg54LRCD/ezo0RfYSb1F0CUPFHB X671fhk9FYwTkEZ84FKw7gwvCzVr6BozzooX7bECAnQnuYZBqFjvVThatM7XLyE0Cy4B /TvMd2AaJhihVbWhzoNevEpUqBVdKEcu4osPXAvt0l3Uljjjp4eV5FqWTLs8YBesOOna DD8h0IsGKfSnHW0gythNPnLPZI/LknXlO1SHr/2P/UKdYiTcRjPPl6nkZhu0+cYs5aom oyWo5YYOTe63NF1qomhbhCTttmGpFLRf3SKSkl7ywEdCRAQ7oXg1IvOANe9QJkJC11xS 9rRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="uE3/WpkD"; 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 g1si3663191edn.100.2020.10.28.02.10.08; Wed, 28 Oct 2020 02:10:30 -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="uE3/WpkD"; 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 S1757266AbgJ0ORI (ORCPT + 99 others); Tue, 27 Oct 2020 10:17:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:34894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409905AbgJ0ON2 (ORCPT ); Tue, 27 Oct 2020 10:13:28 -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 C07302072D; Tue, 27 Oct 2020 14:13:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808008; bh=Rjr/AYJ6z4qLYNmPgGD3eZQOjOTcbOLR5DGJXuwEh8E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uE3/WpkDcCg/g3R+dLS1NZSncWnY4jBfJh6ZGc9Tqo3Q6WEnD7jaEHZMqroHq8S5M JKMRbHBjHctdxFp+IWRu4t6xprYaDe0U57LEndQEy0KTIFxmPCORUirDYAtcuxsJ09 oaPPgb0+gqhdsyw+jyWkAVOlHAIPQtG8oThoFzUQ= 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.14 122/191] Input: omap4-keypad - fix handling of platform_get_irq() error Date: Tue, 27 Oct 2020 14:49:37 +0100 Message-Id: <20201027134915.559098521@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@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 616fdd94b0694..5480f1a5658ee 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