Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp537421pxx; Wed, 28 Oct 2020 10:33:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQkTE/nCMglZ0ckXbUtSZPfy/C2vz7cob+yVQh5AwqAgEPm5ZzBSbrKRo7hB/tFf6V7xxT X-Received: by 2002:a50:e40c:: with SMTP id d12mr8778701edm.35.1603906420847; Wed, 28 Oct 2020 10:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603906420; cv=none; d=google.com; s=arc-20160816; b=mGARfam0Foytr2p6QV1lHfF/fJPE/lG2rVHAogpy3GflSX1afbQXwkDso58lF13SCD YltiVfS2/nbO5tPPQ1hzO0+BENhp20RXCdo08fqWDaXKxkplG0nBVjM/eOogFTjy+YTN cIg1nLF+u/E2FUlPIX6aFQUDucvVIJGN1VyN8+OkPCIP2qtMAH39QvItX8lG1JIGjfU7 4hAhkRHBa9uBKF6b9//v/NAaBv0regn4ofxURNyqkvV5pbgkvmx53jh4v6/7e2jyeiJD A+TW1fKGGkQCQMqDrmY9TCes91mSyvgXggb7j57cT9m/ialkyfOE9AL/9LZrKei2sCip ah/Q== 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=4QNzcbxJi9U/WQXuDF4HuE5DNmaQ2Np0RlYBNs+pUzA=; b=Fl028YFqnJ2wXULgc4AdJV2SPu5kSuaQ3hyN54VJ3Ktxk5UvwmgQ1Y7YVhOpL8l5Rz VDw+HkD2wuD8NHp+XZsDbHEwotA59HXRYzicFz87bVgKJjjYHqTws+J+FzR+3ZL+0Bdg mwe2SiKpALi8PWK6Ht+86kB1sEbrS69IMit+xu0gk3zsf36uu+SgY55s6LtaIrZOK4nm zvCvAShALFdiVm+rcFTY6pINO3vKOiJmsk9wkoxbB3Z5hHmN72P6swPeFQ5tikldAL6/ cyUBFOR9bm39qNzlZAlavm1qMJALN7dQ4fuu33vBASV39TswQuGDtOGxz1qEdGhJ0Nuw +4pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WhLZe3DN; 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 w11si3696538ejq.533.2020.10.28.10.33.17; Wed, 28 Oct 2020 10:33:40 -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=WhLZe3DN; 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 S1822091AbgJ0Rqx (ORCPT + 99 others); Tue, 27 Oct 2020 13:46:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:57448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759370AbgJ0Oas (ORCPT ); Tue, 27 Oct 2020 10:30:48 -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 7128720754; Tue, 27 Oct 2020 14:30:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809048; bh=gu14B/3XyOqUww19uJ6tUihj6C0vESM6NGFqZSz5VoI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WhLZe3DNXHJQXzgdg9UO4vTsp8ryooRlXfRe71DckpWDRVazixZKP95P7X1caTj8X dP8QsqHB8R4nhmeNQyDPhWH3QykXQLPXKBLAZA/31F3Utq9k3ejgJuYuw+0XwN3epe bU0rXYPq/NZCFi+w9gCVjgGNGjw/5WzCU4+Iar7E= 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.4 057/408] EDAC/ti: Fix handling of platform_get_irq() error Date: Tue, 27 Oct 2020 14:49:55 +0100 Message-Id: <20201027135457.711929390@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 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 6ac26d1b929f0..3247689467435 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; -- 2.25.1