From patchwork Fri Sep 21 06:14:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 185586 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (unknown [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6A9592C0080 for ; Fri, 21 Sep 2012 16:16:11 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TEwVS-0006wA-Tp; Fri, 21 Sep 2012 06:14:30 +0000 Received: from mail-qa0-f49.google.com ([209.85.216.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TEwVP-0006vC-1O for linux-arm-kernel@lists.infradead.org; Fri, 21 Sep 2012 06:14:27 +0000 Received: by qafk1 with SMTP id k1so990294qaf.15 for ; Thu, 20 Sep 2012 23:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=KUhv6WNqytze0uFGXwbyG2uJehI5fUEZH/d3PktOYNc=; b=qc+/C+mhhNG39DO0xveaWOTW1tERKwdqZtZT8QRtPx4RmsNWyEitZsefsVwVd+rUGd Rie44YlYjzwT719P9S6bIz55Ako/WpLlkUlReG/nGOnlAp4EDpvJaUI8VVmS40VdyiY0 QaVConeosIJyA80Qf/Kwr67rQqrBNLOVmpmXRmALLhG+FIg27THH+cqs+O3cVpjVbVBO uGqNFx3+SgdNEh7Qdaak1CvMEyVjxmzS+fQqELwhqkcVvPAbIx7+mt95+IO60VxpTUqY OtbNSjOpWGFTdUbNXfG7JNkzhSLoY2zAeWO5YK5f6hTshOERaHIdyYE7P8Q9+789JqoP 5wGw== MIME-Version: 1.0 Received: by 10.224.168.83 with SMTP id t19mr10303633qay.8.1348208065940; Thu, 20 Sep 2012 23:14:25 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Thu, 20 Sep 2012 23:14:25 -0700 (PDT) Date: Fri, 21 Sep 2012 14:14:25 +0800 Message-ID: Subject: [PATCH] ARM: imx: fix the return value check in imx_clk_busy_divider() From: Wei Yongjun To: kernel@pengutronix.de, linux@arm.linux.org.uk X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.216.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (weiyj.lk[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: yongjun_wei@trendmicro.com.cn, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org From: Wei Yongjun In case of error, the function clk_register() returns ERR_PTR() no NULL pointer. The NULL test in the return value check should be replaced with IS_ERR(). dpatch engine is used to auto generated this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun --- arch/arm/mach-imx/clk-busy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/clk-busy.c b/arch/arm/mach-imx/clk-busy.c index 1a7a8dd..1ab91b5 100644 --- a/arch/arm/mach-imx/clk-busy.c +++ b/arch/arm/mach-imx/clk-busy.c @@ -108,7 +108,7 @@ struct clk *imx_clk_busy_divider(const char *name, const char *parent_name, busy->div.hw.init = &init; clk = clk_register(NULL, &busy->div.hw); - if (!clk) + if (IS_ERR(clk)) kfree(busy); return clk;