From patchwork Thu Sep 6 14:25:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chander Kashyap X-Patchwork-Id: 1415161 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 5A2D7DFFCF for ; Thu, 6 Sep 2012 14:29:10 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T9d23-0006hv-Ng; Thu, 06 Sep 2012 14:26:11 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T9d1z-0006hD-MA for linux-arm-kernel@lists.infradead.org; Thu, 06 Sep 2012 14:26:08 +0000 Received: by pbbrq8 with SMTP id rq8so2633767pbb.36 for ; Thu, 06 Sep 2012 07:26:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=pZicqJWEceRMdfpYBio/LnPHpLYHpWmy9//W/DU6VYo=; b=Zv+blm+zUCi7BwW7iTFq3geyp5hwxCFAX7tCQXckwbkWv9CxbCsI5Y9Lq9DlVf6rT2 ySCWz7ElR5hjLp+RzOWuCyy/D9nhKTd7k2mAa1KKZkdPSVLLMv2A7iAdwBgAMxYmDbGc Q5pxXTrGNSFLlmeOA2rtNmgFYdCiC/Oxr7+JM4IcysoTbNQzFIkt+Ui4DHgSJq+FGTb8 b8zQIX6ra+vXT0n6WdYosu6w/NC+PPetNzw3/8mxvvktWGlH74+HTpV7/sETA9yid7rJ HVXeSLCZXfnGdS0Soq8ruEVa+CvnKBhWDrq2rA+F6kqSoOke54g5Zu2aQYdt1xE95K9W /wvw== Received: by 10.68.134.228 with SMTP id pn4mr4721947pbb.147.1346941566522; Thu, 06 Sep 2012 07:26:06 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id th6sm1433672pbc.0.2012.09.06.07.26.03 (version=SSLv3 cipher=OTHER); Thu, 06 Sep 2012 07:26:05 -0700 (PDT) From: Chander Kashyap To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 2/2] ARM: SAMSUNG: Add check for NULL in clock interface Date: Thu, 6 Sep 2012 19:55:34 +0530 Message-Id: <1346941534-4501-1-git-send-email-chander.kashyap@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQlsqM0zPAgKso68Wnt9Dh0F+RACSmaK+xEa4Us6Iujn1gK8RLFxDebMLf+06IkP/KYhUDF4 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: kgene.kim@samsung.com, linux-arm-kernel@lists.infradead.org, patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The clock instance parameter in Samsung clock interface is not being checked for NULL pointers. Add checks for NULL pointers. Signed-off-by: Chander Kashyap Acked-by: Thomas Abraham --- arch/arm/plat-samsung/clock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c index 65c5eca..7938fbc 100644 --- a/arch/arm/plat-samsung/clock.c +++ b/arch/arm/plat-samsung/clock.c @@ -119,7 +119,7 @@ void clk_disable(struct clk *clk) unsigned long clk_get_rate(struct clk *clk) { - if (IS_ERR(clk)) + if (IS_ERR_OR_NULL(clk)) return 0; if (clk->rate != 0) @@ -136,7 +136,7 @@ unsigned long clk_get_rate(struct clk *clk) long clk_round_rate(struct clk *clk, unsigned long rate) { - if (!IS_ERR(clk) && clk->ops && clk->ops->round_rate) + if (!IS_ERR_OR_NULL(clk) && clk->ops && clk->ops->round_rate) return (clk->ops->round_rate)(clk, rate); return rate; @@ -146,7 +146,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate) { int ret; - if (IS_ERR(clk)) + if (IS_ERR_OR_NULL(clk)) return -EINVAL; /* We do not default just do a clk->rate = rate as @@ -175,7 +175,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent) { int ret = 0; - if (IS_ERR(clk)) + if (IS_ERR_OR_NULL(clk) || IS_ERR_OR_NULL(parent)) return -EINVAL; spin_lock(&clocks_lock);