From patchwork Tue Oct 29 02:07:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 3105981 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 09870BF924 for ; Tue, 29 Oct 2013 02:08:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4500520328 for ; Tue, 29 Oct 2013 02:08:37 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 320F42034E for ; Tue, 29 Oct 2013 02:08:36 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VayjR-0008Cb-4U; Tue, 29 Oct 2013 02:08:33 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VayjO-00079D-ER; Tue, 29 Oct 2013 02:08:30 +0000 Received: from mail-bk0-f43.google.com ([209.85.214.43]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VayjJ-00077X-8I for linux-arm-kernel@lists.infradead.org; Tue, 29 Oct 2013 02:08:27 +0000 Received: by mail-bk0-f43.google.com with SMTP id mz13so2116121bkb.2 for ; Mon, 28 Oct 2013 19:07:57 -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=WsWrdU7mitPSW0McVIHQ10XIDsz4hSPPDFy5uNgkuac=; b=qU98RnWMQDzod6s2YaCArBlhe5vFizZzV5SaaPBGPNlunhFcCy06Dn/uM7d4BMyZ9Q nBaEDsiieJRqjdOgpojyxsMZcboKFJ9C6m7TWt727ErJirgB4HDwrOAtdIso14WKjUFT VKwt5lDXUV08YIlH5wVvYCg7r43t8k89KQSFr6sNVEQeJBufnNnKKHZx/dGoFyrfbzaQ Pt1eIDVdttrBSxBE7tA9kPBpwoWy5z4fUF7WvMYVOnozQTV7gzN7b0s54WIwbn2GvJNy wkBArfs9QDC2cSM+zwGUokbgbUpo9VukPiw5k1o9UaGv9ocoWOLNYLaxqiV8kYwI7fly Xs2A== MIME-Version: 1.0 X-Received: by 10.204.69.202 with SMTP id a10mr170876bkj.36.1383012477321; Mon, 28 Oct 2013 19:07:57 -0700 (PDT) Received: by 10.205.19.10 with HTTP; Mon, 28 Oct 2013 19:07:57 -0700 (PDT) Date: Tue, 29 Oct 2013 10:07:57 +0800 Message-ID: Subject: [PATCH] clk: tegra: fix return value check in tegra_clk_register_pllc() From: Wei Yongjun To: mturquette@linaro.org, swarren@wwwdotorg.org, pdeschrijver@nvidia.com, pgaikwad@nvidia.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131028_220825_408496_0BC5D313 X-CRM114-Status: GOOD ( 10.77 ) X-Spam-Score: -2.7 (--) Cc: linux-tegra@vger.kernel.org, yongjun_wei@trendmicro.com.cn, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function __clk_lookup() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun --- drivers/clk/tegra/clk-pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c index 197074a..a99bef7 100644 --- a/drivers/clk/tegra/clk-pll.c +++ b/drivers/clk/tegra/clk-pll.c @@ -1507,7 +1507,7 @@ struct clk *tegra_clk_register_pllc(const char *name, const char *parent_name, return ERR_PTR(-EINVAL); parent = __clk_lookup(parent_name); - if (IS_ERR(parent)) { + if (!parent) { WARN(1, "parent clk %s of %s must be registered first\n", name, parent_name); return ERR_PTR(-EINVAL);