From patchwork Wed Sep 14 10:38:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9331173 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 E5AA7607FD for ; Wed, 14 Sep 2016 10:41:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8995285AC for ; Wed, 14 Sep 2016 10:41:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9542288CF; Wed, 14 Sep 2016 10:41:07 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 48712285AC for ; Wed, 14 Sep 2016 10:41:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755489AbcINKlG (ORCPT ); Wed, 14 Sep 2016 06:41:06 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:34667 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753245AbcINKlF (ORCPT ); Wed, 14 Sep 2016 06:41:05 -0400 Received: by mail-qk0-f194.google.com with SMTP id b204so714089qkc.1; Wed, 14 Sep 2016 03:41:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:cc:subject:date:in-reply-to:references; bh=4a4uWrhysNAoLptZ/ZDKavs/rivikvmEvYPkUhRmCcs=; b=Ylo3D3FoPpbxu7DIJyo8vX3zsxpeEEPVKWc1TINMz8Y7HTbV12Z813HHW2Fja8QPlf 5w+tufQlLInlO+/MsZod7s6sS/fErnHtQGzM3ikYTu4MenuPmHYWStQxaF83CYChC7VW H7zbMDLFv2tCdSuw5MFQzfEXxti32xuP8bB8sDcDxtQg3kIuQ7/CvV9iLt1x8kjiU3TZ 9Xaqp0sHOv82kqSyjOTNK3fM1A49efk/9FkIbec8h7JUs3O190iLgyWdPbDDQSiKQhMI bj0PxYjs9cAr1Mj3WpzwnG/97aaXB6fxuDepTZ8iJhFWxAj0oAYZtbRiVA/oCo+WZ8fN jnKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:from:to:cc:subject:date:in-reply-to :references; bh=4a4uWrhysNAoLptZ/ZDKavs/rivikvmEvYPkUhRmCcs=; b=Hmz62CoaRpDlsB/aSZmUZJIPYETUPwQQU6asXrnhgTX66LcGCFFdWxhq66VhrVbyG6 DBA3V3sbsjKGGa7Rl59drChjaaPKjuY9nZYR82wW/2m0NmxArfXDW5ABr+3V9u/QgJg5 pqcNP/hOY83wsEChwJDXOKf6h2YeLux3hIuSMvooTS1CfGtpY/ldlufwNtsNNVLZU9dH UkQXIR4/+hDKjwRxyLF9q+rPnuvWu7gc9T00T+0C2aceqkhlmZDXswySa84Ig2db6Nic VwKc08F2wReThrEQccuumoKfXVqrD0Z/vHqTZSPhWkRkXi7qAgXj61jVixC50GyNszCJ r3ug== X-Gm-Message-State: AE9vXwMlRYA2j/bTojl0M9rpPHYmrR4tq6XVnhKkmkH+dUtBESjkHDNGWsa6OSXCqdJv9g== X-Received: by 10.55.135.6 with SMTP id j6mr2177298qkd.270.1473849664602; Wed, 14 Sep 2016 03:41:04 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.symbol.com ([140.101.159.242]) by smtp.googlemail.com with ESMTPSA id z32sm1893837qtz.0.2016.09.14.03.41.01 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Sep 2016 03:41:04 -0700 (PDT) Message-ID: <57d92940.6329c80a.3d959.9d78@mx.google.com> X-Google-Original-Message-ID: <1473849511-15194-1-git-send-email-y> From: arvind.yadav.cs@gmail.com X-Google-Original-From: y To: mturquette@baylibre.com, sboyd@codeaurora.org Cc: a.hajda@samsung.com, lee.jones@linaro.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Arvind Yadav Subject: [PATCH] clk: st: clk-flexgen: Unmap region obtained by of_iomap Date: Wed, 14 Sep 2016 16:08:31 +0530 X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: 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 probe is not successful. Signed-off-by: Arvind Yadav --- drivers/clk/st/clk-flexgen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/clk/st/clk-flexgen.c b/drivers/clk/st/clk-flexgen.c index 546bd79..af8df7b 100644 --- a/drivers/clk/st/clk-flexgen.c +++ b/drivers/clk/st/clk-flexgen.c @@ -278,8 +278,10 @@ static void __init st_of_flexgen_setup(struct device_node *np) return; parents = flexgen_get_parents(np, &num_parents); - if (!parents) + if (!parents) { + iounmap(reg); return; + } clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); if (!clk_data) @@ -337,6 +339,8 @@ static void __init st_of_flexgen_setup(struct device_node *np) return; err: + if (reg) + iounmap(reg); if (clk_data) kfree(clk_data->clks); kfree(clk_data);