From patchwork Mon Sep 19 08:21:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9338785 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 0E3976077A for ; Mon, 19 Sep 2016 08:25:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF1EE28B96 for ; Mon, 19 Sep 2016 08:25:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E17A528B9A; Mon, 19 Sep 2016 08:25:21 +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 8490528B96 for ; Mon, 19 Sep 2016 08:25:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938640AbcISIXh (ORCPT ); Mon, 19 Sep 2016 04:23:37 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36055 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932589AbcISIWY (ORCPT ); Mon, 19 Sep 2016 04:22:24 -0400 Received: by mail-pf0-f194.google.com with SMTP id n24so6906326pfb.3; Mon, 19 Sep 2016 01:22:24 -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=FpkVqfRho3LUCZgHXG8nq6vzKItEPM3C8xBFf+Np8Tc=; b=REC4IBQXDriQRO6oJ85czLDZ2UmOPe4oiWQiloOH9eWci2v7lTu3sUEx55aEZqSNRV HO7mlz0OWioA++ZEwwJxkz1obsxWoDEREkKSACU5JJJ/yWGyd2YloPaFYbUQxeoXl5+O J/gaDK4r7MVS+VhDgA3vYxps6mtQn7KKgj/wDLxv4vplROGtEgqh3yM9vqbAOdqK7rr6 rJYzwYYP1I9tWsymN3neZcpELTjZ6BWodkvoNst9yazXPoNpKvrPS3RIHY3AyELU8Lae N4BjwGWr+ZK927sZZXAydbybpUNxRQRzo/rnaotArfkAm6kikdRplmOVdkdQxMcw6Q8s tKVg== 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=FpkVqfRho3LUCZgHXG8nq6vzKItEPM3C8xBFf+Np8Tc=; b=adpH3eZuisCR5KjCSs9fxvl+j2/q+LoUuoLR1JYMePEDuu85/KkgS3kjKYXiYsoai7 wV99qelG3fKKYdnqsAPqoU7gcAPabqbKLTyYwLTe3BwLeioisluEdL1BW/bn0lArv3Pc C8QgAMC4F1Ww3z8CTM3azfKNS9iXtvavfah8RITaGcW7IomkkuOGkMUOKKLKXwxrMI73 BIJ3wHPJkucFILEDFsQ/cGaT+EO261lsZeRA9D19rGWBiKx5Bi1iMUrojFIGT5bt0cIL 8VvbohdEDpU/O/7Da31kc7/rqmqrBzP2zsNtI4f7ml92rOtJeHLCGxsK5jnUGlV6YGbP y2fg== X-Gm-Message-State: AE9vXwOmu0pbmdoNH+gLUxqVZ7qMEWkSimk18XvCPag8NONVCBPUVUiU4kooNCIJU5c4Ew== X-Received: by 10.98.159.194 with SMTP id v63mr44894304pfk.91.1474273343568; Mon, 19 Sep 2016 01:22:23 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.symbol.com ([140.101.159.242]) by smtp.googlemail.com with ESMTPSA id p74sm69264063pfk.68.2016.09.19.01.22.20 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Sep 2016 01:22:23 -0700 (PDT) From: Arvind yadav X-Google-Original-From: Arvind yadav 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: [v2] clk: st: clk-flexgen: Unmap region obtained by of_iomap Date: Mon, 19 Sep 2016 13:51:24 +0530 Message-Id: <1474273285-9053-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 probe is not successful. Signed-off-by: Arvind Yadav --- drivers/clk/st/clk-flexgen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/clk/st/clk-flexgen.c b/drivers/clk/st/clk-flexgen.c index 546bd79..ba69098 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,7 @@ static void __init st_of_flexgen_setup(struct device_node *np) return; err: + iounmap(reg); if (clk_data) kfree(clk_data->clks); kfree(clk_data);