Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Wei Yongjun and committed by
Michael Ellerman
35a7f41c a368c29c

+2 -2
+2 -2
arch/powerpc/sysdev/ppc4xx_hsta_msi.c
··· 132 132 struct pci_controller *phb; 133 133 134 134 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 135 - if (IS_ERR(mem)) { 135 + if (!mem) { 136 136 dev_err(dev, "Unable to get mmio space\n"); 137 137 return -EINVAL; 138 138 } ··· 157 157 goto out; 158 158 159 159 ppc4xx_hsta_msi.irq_map = kmalloc(sizeof(int) * irq_count, GFP_KERNEL); 160 - if (IS_ERR(ppc4xx_hsta_msi.irq_map)) { 160 + if (!ppc4xx_hsta_msi.irq_map) { 161 161 ret = -ENOMEM; 162 162 goto out1; 163 163 }