Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc0e1c91 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Greg Kroah-Hartman
Browse files

EDAC/ti: Fix handling of platform_get_irq() error



[ 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: 86a18ee2 ("EDAC, ti: Add support for TI keystone and DRA7xx EDAC")
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Reviewed-by: default avatarTero Kristo <t-kristo@ti.com>
Link: https://lkml.kernel.org/r/20200827070743.26628-2-krzk@kernel.org


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 00aed0ea
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;