From patchwork Thu Aug 27 07:07:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11740095 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A23714F6 for ; Thu, 27 Aug 2020 07:07:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7132622BF5 for ; Thu, 27 Aug 2020 07:07:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598512072; bh=N/nhk9ZU4iq0+cgOvmAy8U6IL85LhG10MTNPMpmXw0M=; h=From:To:Cc:Subject:Date:List-ID:From; b=teL1MJAnVx8JiwKAsia1Moh5Ysdb4mxeO/iUdlGJFznBXyMChMKerJf/q9OBdI6cm XOoDkV1chafZzoEMLNyNPc9SePaVkDy0q54rn+JG6B6gMtbTgBeNP6QzAEu3ZjtkC1 LZig2i8L6ZM9dglbGPJ4WOrHXGXhDmacYBeDoUKk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727066AbgH0HHv (ORCPT ); Thu, 27 Aug 2020 03:07:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:43386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726123AbgH0HHv (ORCPT ); Thu, 27 Aug 2020 03:07:51 -0400 Received: from kozik-lap.mshome.net (unknown [194.230.155.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D2F9F20786; Thu, 27 Aug 2020 07:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598512071; bh=N/nhk9ZU4iq0+cgOvmAy8U6IL85LhG10MTNPMpmXw0M=; h=From:To:Cc:Subject:Date:From; b=UtVeiKwEjA811MRUai0bNAO/xw87FSHGWyrpQrDg32A/0z24mHKXEQ3gH2p6R+6P6 9s1CpkfYQxiILIMcpsPAk0Hs01ZBhyQbzMoXlFUqxk3wcocXXiVWJA3at0kDS2OLra 5hotaSRyL5GfHdrORiUMVhV2Z0AhqKmi0o8U9glg= From: Krzysztof Kozlowski To: Stefan Schaeckeler , Borislav Petkov , Mauro Carvalho Chehab , Tony Luck , James Morse , Robert Richter , Joel Stanley , Andrew Jeffery , Tero Kristo , linux-edac@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 1/2] EDAC/aspeed: Fix handling of platform_get_irq() error Date: Thu, 27 Aug 2020 09:07:42 +0200 Message-Id: <20200827070743.26628-1-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 Sender: linux-edac-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check. Fixes: 9b7e6242ee4e ("EDAC, aspeed: Add an Aspeed AST2500 EDAC driver") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stefan Schaeckeler --- drivers/edac/aspeed_edac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c index b194658b8b5c..fbec28dc661d 100644 --- a/drivers/edac/aspeed_edac.c +++ b/drivers/edac/aspeed_edac.c @@ -209,8 +209,8 @@ static int config_irq(void *ctx, struct platform_device *pdev) /* register interrupt handler */ irq = platform_get_irq(pdev, 0); dev_dbg(&pdev->dev, "got irq %d\n", irq); - if (!irq) - return -ENODEV; + if (irq < 0) + return irq; rc = devm_request_irq(&pdev->dev, irq, mcr_isr, IRQF_TRIGGER_HIGH, DRV_NAME, ctx);