From patchwork Tue Jan 14 18:43:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 3487481 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 324539F4DC for ; Tue, 14 Jan 2014 18:43:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 718782021B for ; Tue, 14 Jan 2014 18:43:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8EB1C2022F for ; Tue, 14 Jan 2014 18:43:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751752AbaANSnc (ORCPT ); Tue, 14 Jan 2014 13:43:32 -0500 Received: from 82-68-191-81.dsl.posilan.com ([82.68.191.81]:33844 "EHLO rainbowdash.ducie.codethink.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751762AbaANSnb (ORCPT ); Tue, 14 Jan 2014 13:43:31 -0500 Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.82) (envelope-from ) id 1W38xV-0001Jn-2z; Tue, 14 Jan 2014 18:43:29 +0000 From: Ben Dooks To: linux-sh@vger.kernel.org Cc: horms+renesas@verge.net.au, laurent.pinchart+renesas@ideasonboard.com, Ben Dooks Subject: [PATCH 2/2] ARM: shmobile: koelsch: fix error return code check from clk_get() Date: Tue, 14 Jan 2014 18:43:27 +0000 Message-Id: <1389725007-5023-3-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1389725007-5023-1-git-send-email-ben.dooks@codethink.co.uk> References: <1389725007-5023-1-git-send-email-ben.dooks@codethink.co.uk> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 The koelsch_add_standard_devices() function calls clk_get() but then fails to check that it returns an error pointer instead of NULL on failure. This was added by f31239ef ("ARM: shmobile: koelsch-reference: Instantiate clkdevs for SCIF and CMT") in horms' renesas-boards2-for-v3.14~6 release. The issue is not serious as it does not cause a crash and seems to not be actually causing any issues now the other clock bugs have been fixed. Cc: Laurent Pinchart Cc: Simon Horman Signed-off-by: Ben Dooks --- arch/arm/mach-shmobile/board-koelsch-reference.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c index 652b592..feb8d97 100644 --- a/arch/arm/mach-shmobile/board-koelsch-reference.c +++ b/arch/arm/mach-shmobile/board-koelsch-reference.c @@ -45,14 +45,14 @@ static void __init koelsch_add_standard_devices(void) for (i = 0; i < ARRAY_SIZE(scif_names); ++i) { clk = clk_get(NULL, scif_names[i]); - if (clk) { + if (!IS_ERR(clk)) { clk_register_clkdev(clk, NULL, "sh-sci.%u", i); clk_put(clk); } } clk = clk_get(NULL, "cmt0"); - if (clk) { + if (!IS_ERR(clk)) { clk_register_clkdev(clk, NULL, "sh_cmt.0"); clk_put(clk); }