Skip to content

Commit

Permalink
memory: fsl-corenet-cf: Fix handling of platform_get_irq() error
Browse files Browse the repository at this point in the history
[ Upstream commit dd85345 ]

platform_get_irq() returns -ERRNO on error.  In such case comparison
to 0 would pass the check.

Fixes: 54afbec ("memory: Freescale CoreNet Coherency Fabric error reporting driver")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20200827073315.29351-1-krzk@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
krzk authored and gregkh committed Oct 29, 2020
1 parent d125fc7 commit 570bcf7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/memory/fsl-corenet-cf.c
Expand Up @@ -211,10 +211,8 @@ static int ccf_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, ccf);

irq = platform_get_irq(pdev, 0);
if (!irq) {
dev_err(&pdev->dev, "%s: no irq\n", __func__);
return -ENXIO;
}
if (irq < 0)
return irq;

ret = devm_request_irq(&pdev->dev, irq, ccf_irq, 0, pdev->name, ccf);
if (ret) {
Expand Down

0 comments on commit 570bcf7

Please sign in to comment.