diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2020-08-27 09:07:43 +0200 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2020-09-01 20:43:20 +0200 |
commit | 66077adb70a2a9e92540155b2ace33ec98299c90 (patch) | |
tree | e6dc22c8da87b401129f0708454c59656a0381d7 /drivers/edac/ti_edac.c | |
parent | afce6996943be265fa39240b67025cfcb1bcdfb1 (diff) |
EDAC/ti: Fix handling of platform_get_irq() error
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 <krzk@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Tero Kristo <t-kristo@ti.com>
Link: https://lkml.kernel.org/r/20200827070743.26628-2-krzk@kernel.org
Diffstat (limited to 'drivers/edac/ti_edac.c')
-rw-r--r-- | drivers/edac/ti_edac.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/edac/ti_edac.c b/drivers/edac/ti_edac.c index 6e52796a0b41..e7eae20f83d1 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; |