Skip to content

Commit 66077ad

Browse files
krzksuryasaimadhu
authored andcommitted
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: 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
1 parent afce699 commit 66077ad

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/edac/ti_edac.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ static int ti_edac_probe(struct platform_device *pdev)
278278

279279
/* add EMIF ECC error handler */
280280
error_irq = platform_get_irq(pdev, 0);
281-
if (!error_irq) {
281+
if (error_irq < 0) {
282+
ret = error_irq;
282283
edac_printk(KERN_ERR, EDAC_MOD_NAME,
283284
"EMIF irq number not defined.\n");
284285
goto err;

0 commit comments

Comments
 (0)