Skip to content

Commit afce699

Browse files
krzksuryasaimadhu
authored andcommitted
EDAC/aspeed: 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: 9b7e624 ("EDAC, aspeed: Add an Aspeed AST2500 EDAC driver") Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Stefan Schaeckeler <schaecsn@gmx.net> Link: https://lkml.kernel.org/r/20200827070743.26628-1-krzk@kernel.org
1 parent 857a313 commit afce699

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/edac/aspeed_edac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ static int config_irq(void *ctx, struct platform_device *pdev)
209209
/* register interrupt handler */
210210
irq = platform_get_irq(pdev, 0);
211211
dev_dbg(&pdev->dev, "got irq %d\n", irq);
212-
if (!irq)
213-
return -ENODEV;
212+
if (irq < 0)
213+
return irq;
214214

215215
rc = devm_request_irq(&pdev->dev, irq, mcr_isr, IRQF_TRIGGER_HIGH,
216216
DRV_NAME, ctx);

0 commit comments

Comments
 (0)