From patchwork Tue Sep 20 10:39:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9341461 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 419E6601C2 for ; Tue, 20 Sep 2016 10:40:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31B0529EDA for ; Tue, 20 Sep 2016 10:40:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 262D729EE2; Tue, 20 Sep 2016 10:40:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71EBD29EDA for ; Tue, 20 Sep 2016 10:40:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932743AbcITKkp (ORCPT ); Tue, 20 Sep 2016 06:40:45 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:35516 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932517AbcITKkp (ORCPT ); Tue, 20 Sep 2016 06:40:45 -0400 Received: by mail-pa0-f68.google.com with SMTP id hi10so771776pac.2; Tue, 20 Sep 2016 03:40:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ARFJsRvLwLtBJnySFPz6KtrsgJgmoHFqej+VRnI1Bqo=; b=TsNqR6b5wUI1GJr+PAyIPQv60ofdH/9pzWPI+7ENkf15b4DWOpFcN1blKiqoUi3SkA 6PRMMtiLLoLCN2S1y31mLzwKnRu4sCS+uyNV7v3qRGcqYDXr+Be//GWHrssaUsqxxnxr WQmaqgT7LtJfkwHB5zggmJkXm+IsHH65f2VGeejjRWhGDirXVyI6FDJso+VjnocTZ0td YdCPjcME/rnt4nrp4wvaBZF5FhTEdMGjQUd9JNNvw/7S4VRBc7nUwnb3EEn60pfTS9VR zImH34PylcVSG+8C6sMJR4BoVP+Fpz3cGS992OO5QlfeLziI4MqzPn2kbCTEFyjkoesB T/Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ARFJsRvLwLtBJnySFPz6KtrsgJgmoHFqej+VRnI1Bqo=; b=harXkDXNtRIiEHc3qtnZKq/bw7NFnwPnr722zmcg6fog3HxOXqcWxgLBQ54/LvP9AT X55WC69JHTdB3bDv423bozE8iTFyy/+HUxJCIYLISecgHc+fOvBkMKo80k/NtmaNPWQZ Sz7R7nT3GDK8s8U/kbk9aE6aiqbTpGLrrOESMYzD0Dxt/XG+xGfwswBiOth67o19VkJy qI7mCJdfSerfE1sPV4WHsyWHknXwIJsk5Rg9FpEvvnely+gKVlQPDPqaeHBmaC++s3WW vwrBCvwymLr4nv/6o3YKbRD0ifuqTso1KBxb8/gvTFfQPkeg2jjoiUCpi1F2itPhlP2/ W1Lw== X-Gm-Message-State: AE9vXwPxukhqJbkgvz0FX9ULRXucq1ouQBimvNbkNZYIGnqCfDEEBbCwYxfvcHFpxbUgag== X-Received: by 10.66.1.98 with SMTP id 2mr41330451pal.134.1474368044559; Tue, 20 Sep 2016 03:40:44 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.symbol.com ([140.101.159.242]) by smtp.googlemail.com with ESMTPSA id m5sm38173731paw.40.2016.09.20.03.40.41 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Sep 2016 03:40:44 -0700 (PDT) From: Arvind Yadav X-Google-Original-From: Arvind Yadav To: mturquette@baylibre.com, sboyd@codeaurora.org, manabian@gmail.com Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Arvind Yadav Subject: [PATCH] clk: nxp: clk-lpc18xx-ccu: Unmap region obtained by of_iomap Date: Tue, 20 Sep 2016 16:09:47 +0530 Message-Id: <1474367987-15808-1-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Arvind Yadav Free memory mapping, if lpc18xx_ccu_init is not successful. Signed-off-by: Arvind Yadav Acked-by: Joachim Eastwood --- drivers/clk/nxp/clk-lpc18xx-ccu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/clk/nxp/clk-lpc18xx-ccu.c b/drivers/clk/nxp/clk-lpc18xx-ccu.c index f7136b9..27781b4 100644 --- a/drivers/clk/nxp/clk-lpc18xx-ccu.c +++ b/drivers/clk/nxp/clk-lpc18xx-ccu.c @@ -277,12 +277,15 @@ static void __init lpc18xx_ccu_init(struct device_node *np) } clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); - if (!clk_data) + if (!clk_data) { + iounmap(reg_base); return; + } clk_data->num = of_property_count_strings(np, "clock-names"); clk_data->name = kcalloc(clk_data->num, sizeof(char *), GFP_KERNEL); if (!clk_data->name) { + iounmap(reg_base); kfree(clk_data); return; }