diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2020-08-27 09:07:42 +0200 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2020-09-01 20:41:27 +0200 |
commit | afce6996943be265fa39240b67025cfcb1bcdfb1 (patch) | |
tree | e83dd5b58a5ef96fe3062547e2da260fccfcfe81 /drivers/edac | |
parent | 857a3139bd8be4f702c030c8ca06f3fd69c1741a (diff) | |
download | linux-afce6996943be265fa39240b67025cfcb1bcdfb1.tar.gz linux-afce6996943be265fa39240b67025cfcb1bcdfb1.tar.bz2 linux-afce6996943be265fa39240b67025cfcb1bcdfb1.zip |
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: 9b7e6242ee4e ("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
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/aspeed_edac.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c index b194658b8b5c..fbec28dc661d 100644 --- a/drivers/edac/aspeed_edac.c +++ b/drivers/edac/aspeed_edac.c @@ -209,8 +209,8 @@ static int config_irq(void *ctx, struct platform_device *pdev) /* register interrupt handler */ irq = platform_get_irq(pdev, 0); dev_dbg(&pdev->dev, "got irq %d\n", irq); - if (!irq) - return -ENODEV; + if (irq < 0) + return irq; rc = devm_request_irq(&pdev->dev, irq, mcr_isr, IRQF_TRIGGER_HIGH, DRV_NAME, ctx); |