Skip to content

Commit

Permalink
powerpc/4xx: Fix return value check in hsta_msi_probe()
Browse files Browse the repository at this point in the history
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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Wei Yongjun authored and Michael Ellerman committed Aug 6, 2015
1 parent a368c29 commit 35a7f41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/powerpc/sysdev/ppc4xx_hsta_msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static int hsta_msi_probe(struct platform_device *pdev)
struct pci_controller *phb;

mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (IS_ERR(mem)) {
if (!mem) {
dev_err(dev, "Unable to get mmio space\n");
return -EINVAL;
}
Expand All @@ -157,7 +157,7 @@ static int hsta_msi_probe(struct platform_device *pdev)
goto out;

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;
goto out1;
}
Expand Down

0 comments on commit 35a7f41

Please sign in to comment.