Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752812AbcJ3IK0 (ORCPT ); Sun, 30 Oct 2016 04:10:26 -0400 Received: from smtp13.smtpout.orange.fr ([80.12.242.135]:56607 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751764AbcJ3IKX (ORCPT ); Sun, 30 Oct 2016 04:10:23 -0400 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 30 Oct 2016 09:10:21 +0100 X-ME-IP: 92.140.167.9 From: Christophe JAILLET To: jun.nie@linaro.org, linux@armlinux.org.uk Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] ARM: zx: Fix error handling Date: Sun, 30 Oct 2016 09:10:10 +0100 Message-Id: <20161030081010.14735-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.9.3 X-Antivirus: avast! (VPS 161029-0, 29/10/2016), Outbound message X-Antivirus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 851 Lines: 26 'devm_ioremap_resource()' returns an error pointer in case of error, not NULL. So test it with IS_ERR. Signed-off-by: Christophe JAILLET --- 'return -EIO;' could also be turned into 'return PTR_ERR(pcubase);' in order to propagate the error value. --- arch/arm/mach-zx/zx296702-pm-domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c b/arch/arm/mach-zx/zx296702-pm-domain.c index e08574d4e2ca..79dcf2549267 100644 --- a/arch/arm/mach-zx/zx296702-pm-domain.c +++ b/arch/arm/mach-zx/zx296702-pm-domain.c @@ -169,7 +169,7 @@ static int zx296702_pd_probe(struct platform_device *pdev) } pcubase = devm_ioremap_resource(&pdev->dev, res); - if (!pcubase) { + if (IS_ERR(pcubase)) { dev_err(&pdev->dev, "ioremap fail.\n"); return -EIO; } -- 2.9.3