Skip to content

Commit

Permalink
EDAC/ti: Fix handling of platform_get_irq() error
Browse files Browse the repository at this point in the history
[ Upstream commit 66077ad ]

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: 86a18ee ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
krzk authored and gregkh committed Oct 29, 2020
1 parent 0b60f73 commit 3682a4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/edac/ti_edac.c
Expand Up @@ -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;
Expand Down

0 comments on commit 3682a4b

Please sign in to comment.