Commit 35a7f41c authored by Wei Yongjun's avatar Wei Yongjun Committed by Michael Ellerman

powerpc/4xx: Fix return value check in hsta_msi_probe()

In case of error, the functions platform_get_resource() and kmalloc()
returns NULL not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent a368c29c
...@@ -132,7 +132,7 @@ static int hsta_msi_probe(struct platform_device *pdev) ...@@ -132,7 +132,7 @@ static int hsta_msi_probe(struct platform_device *pdev)
struct pci_controller *phb; struct pci_controller *phb;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (IS_ERR(mem)) { if (!mem) {
dev_err(dev, "Unable to get mmio space\n"); dev_err(dev, "Unable to get mmio space\n");
return -EINVAL; return -EINVAL;
} }
...@@ -157,7 +157,7 @@ static int hsta_msi_probe(struct platform_device *pdev) ...@@ -157,7 +157,7 @@ static int hsta_msi_probe(struct platform_device *pdev)
goto out; goto out;
ppc4xx_hsta_msi.irq_map = kmalloc(sizeof(int) * irq_count, GFP_KERNEL); ppc4xx_hsta_msi.irq_map = kmalloc(sizeof(int) * irq_count, GFP_KERNEL);
if (IS_ERR(ppc4xx_hsta_msi.irq_map)) { if (!ppc4xx_hsta_msi.irq_map) {
ret = -ENOMEM; ret = -ENOMEM;
goto out1; goto out1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment