From patchwork Tue Oct 27 13:45:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 289732 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED195C61DD8 for ; Tue, 27 Oct 2020 15:28:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9B1AA22264 for ; Tue, 27 Oct 2020 15:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812496; bh=vivV3xKPzAQjtPZH6nSfZfJGcVRD2ycs4JVZSA+belE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hXE2L/BWdkEwXuE/enMwoeyZTB7PLCALJQmNlwZ4ZmFM21bjjwcVgs2s3IOY2f7OG UgcYgEI19qpooVSr3M9/9OLlk93Bptr8ARiw/cLzu3o7LHa3KH/tt5QYIY8kkokJYg 9gvJXHYqJriGHaLdVv6JqaEUZ9V5cShFU2DmU7jQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1798465AbgJ0P2N (ORCPT ); Tue, 27 Oct 2020 11:28:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:36382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754000AbgJ0PVo (ORCPT ); Tue, 27 Oct 2020 11:21:44 -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 9BFC220657; Tue, 27 Oct 2020 15:21:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812103; bh=vivV3xKPzAQjtPZH6nSfZfJGcVRD2ycs4JVZSA+belE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gHM8dyl5NfhnZGIKe0EBTQMnhkqNE2tB+82r6wk/4ARq4EFzJyCuQgGEgcxdn4vY9 YpbK9F+MfHDspq/zdW+an3NgFF7s1TRp8As0b+koTC1IU6XACLCTJ4IdLMtlGYByPt 5QachTKLk22mCZ3ZkgSv2Cp5H+J0tU4SxUlS9tjE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Borislav Petkov , Tero Kristo , Sasha Levin Subject: [PATCH 5.9 093/757] EDAC/ti: Fix handling of platform_get_irq() error Date: Tue, 27 Oct 2020 14:45:43 +0100 Message-Id: <20201027135454.908431359@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Krzysztof Kozlowski [ Upstream commit 66077adb70a2a9e92540155b2ace33ec98299c90 ] platform_get_irq() returns a negative error number on error. In such a case, comparison to 0 would pass the check therefore check the return value properly, whether it is negative. [ bp: Massage commit message. ] Fixes: 86a18ee21e5e ("EDAC, ti: Add support for TI keystone and DRA7xx EDAC") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Borislav Petkov Reviewed-by: Tero Kristo Link: https://lkml.kernel.org/r/20200827070743.26628-2-krzk@kernel.org Signed-off-by: Sasha Levin --- drivers/edac/ti_edac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/edac/ti_edac.c b/drivers/edac/ti_edac.c index 8be3e89a510e4..d7419a90a2f5b 100644 --- a/drivers/edac/ti_edac.c +++ b/drivers/edac/ti_edac.c @@ -278,7 +278,8 @@ static int ti_edac_probe(struct platform_device *pdev) /* add EMIF ECC error handler */ error_irq = platform_get_irq(pdev, 0); - if (!error_irq) { + if (error_irq < 0) { + ret = error_irq; edac_printk(KERN_ERR, EDAC_MOD_NAME, "EMIF irq number not defined.\n"); goto err;