Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034512AbcJ2N7L (ORCPT ); Sat, 29 Oct 2016 09:59:11 -0400 Received: from smtp07.smtpout.orange.fr ([80.12.242.129]:46234 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034479AbcJ2N7B (ORCPT ); Sat, 29 Oct 2016 09:59:01 -0400 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 29 Oct 2016 15:58:58 +0200 X-ME-IP: 92.140.233.183 From: Christophe JAILLET To: vireshk@kernel.org, shiraz.linux.kernel@gmail.com, 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: spear: Fix error handling Date: Sat, 29 Oct 2016 15:58:39 +0200 Message-Id: <20161029135839.6388-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: 656 Lines: 23 'clk_get_sys()' returns an error pointer in case of error, not NULL. So test it with IS_ERR. Signed-off-by: Christophe JAILLET --- arch/arm/mach-spear/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-spear/time.c b/arch/arm/mach-spear/time.c index 9ccffc1d0f28..4878ba90026d 100644 --- a/arch/arm/mach-spear/time.c +++ b/arch/arm/mach-spear/time.c @@ -233,7 +233,7 @@ void __init spear_setup_of_timer(void) } gpt_clk = clk_get_sys("gpt0", NULL); - if (!gpt_clk) { + if (IS_ERR(gpt_clk)) { pr_err("%s:couldn't get clk for gpt\n", __func__); goto err_iomap; } -- 2.9.3