Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757269AbbDPMUy (ORCPT ); Thu, 16 Apr 2015 08:20:54 -0400 Received: from m12-16.163.com ([220.181.12.16]:33607 "EHLO m12-16.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754664AbbDPMUr (ORCPT ); Thu, 16 Apr 2015 08:20:47 -0400 X-Coremail-DSSMTP: 49.77.26.90 From: weiyj_lk@163.com To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Wolfram Sang , Alexander Gordeev , Wei Yongjun , Thomas Gleixner , Jiang Liu , Alistair Popple Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] powerpc/4xx: Fix return value check in hsta_msi_probe() Date: Thu, 16 Apr 2015 20:18:50 +0800 Message-Id: <1429186730-20723-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-CM-TRANSID: EMCowECJ6lusqC9V5aJ2AQ--.45S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Wr4DKF4fJr1fAr1DWFy3Jwb_yoWktrX_Aw n7ur1DKr45uF4a9FZ8J3Z8Cas8AanrGrs8G39xKasIqa45X343JFW8JryDJF4IqrsYyrWD C3Z5Jr4a9r1IkjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUn_WrJUUUUU== X-Originating-IP: [49.77.26.90] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiNQ3d1lSIF8u6cQAAs4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1387 Lines: 39 From: Wei Yongjun 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 --- arch/powerpc/sysdev/ppc4xx_hsta_msi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/sysdev/ppc4xx_hsta_msi.c b/arch/powerpc/sysdev/ppc4xx_hsta_msi.c index f366d2d..49e24f5 100644 --- a/arch/powerpc/sysdev/ppc4xx_hsta_msi.c +++ b/arch/powerpc/sysdev/ppc4xx_hsta_msi.c @@ -130,7 +130,7 @@ static int hsta_msi_probe(struct platform_device *pdev) int irq, ret, irq_count; 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; } @@ -155,7 +155,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; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/