From patchwork Tue Sep 20 09:52:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9341395 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 DAC62601C2 for ; Tue, 20 Sep 2016 09:53:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9D3A29459 for ; Tue, 20 Sep 2016 09:53:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE6472945F; Tue, 20 Sep 2016 09:53:46 +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 6CA1B29459 for ; Tue, 20 Sep 2016 09:53:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932786AbcITJxp (ORCPT ); Tue, 20 Sep 2016 05:53:45 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36155 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932717AbcITJxp (ORCPT ); Tue, 20 Sep 2016 05:53:45 -0400 Received: by mail-pf0-f195.google.com with SMTP id n24so751620pfb.3; Tue, 20 Sep 2016 02:53: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=on9EOWkxtHZAzEGm0Vz2GmzTvxGUmAsGj4CWJWwSm1A=; b=sLoXUesAzMmt2iSd63GrKuHLxBw4WMxcctrbx+QK869lhEhiSAQaP9K5xVXRbQK5dF X57eEck116EsaIOTeVrNn3p08O2v3ramEygCfjwcMziKMv0IqD2jG6TLnke0RsPZHJYC lJIVCJhzV4kyQOTb2O+VkJMG6kJXNk7W5/kmLcG92ndEzweIoGG/Mil3tkwWFfIXny9j tqldDVdESVM2E6KaM4hSKu67i3aK8A2vUcP/1GtFdxNmD9hRpC9NyRwVPt4Bv6OUIDYc Eb3OH4LiSYxmrxg6g3wZjP7yMEHVfA6+NjlT+uoKRdOct1bRKoJUe7ouciCA+bax5mfb gF2A== 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=on9EOWkxtHZAzEGm0Vz2GmzTvxGUmAsGj4CWJWwSm1A=; b=bSAb+SmYtVDDXA4DY/UYIs5TMkbq7T35zLFHeopchLBLWgEbzoqZ3Hppw2HsWk+uRy W3HRIAaIKq1V6sS+53GeCvzApjBYZZcZwTSdzJpYkKA7RSbyFtA0KPPW3vDG0XQyTuq5 Z8TGhIHWuQBwcEQ4ceD76zp2NCe/bqMdkiGvvjHCKl1TgNezhgIcEDB7HZDqKENtZh4C a3bmBjfD543Nv8GW95YNN2JPF3vIw2BcM3cA32+9/WROKbfYyyr2j3R+1sxIefCKOe2c Zkvi/HqnVlrzpC8bTVoEKd1ojUTyCf2twBI2ntSRRLMeXfStKPqjx8yXex7saa8nqSAy of2Q== X-Gm-Message-State: AE9vXwPGzGqyqTQL4ZjybTVDl05A+PzQRy8rKIXA/LUm8RLIHKMV+0Z7AHHpJTnkMbEyDQ== X-Received: by 10.98.223.218 with SMTP id d87mr55156294pfl.48.1474365224558; Tue, 20 Sep 2016 02:53:44 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.symbol.com ([140.101.159.242]) by smtp.googlemail.com with ESMTPSA id tw2sm37740505pac.41.2016.09.20.02.53.42 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Sep 2016 02:53:43 -0700 (PDT) From: Arvind Yadav X-Google-Original-From: Arvind Yadav To: mturquette@baylibre.com, sboyd@codeaurora.org Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Arvind Yadav Subject: [PATCH] clk: mmp: clk-of-pxa1928: Free memory obtained by kzalloc Date: Tue, 20 Sep 2016 15:22:48 +0530 Message-Id: <1474365168-15489-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, if init is not successful. Signed-off-by: Arvind Yadav --- drivers/clk/mmp/clk-of-pxa1928.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/clk/mmp/clk-of-pxa1928.c b/drivers/clk/mmp/clk-of-pxa1928.c index e478ff4..cede7b4 100644 --- a/drivers/clk/mmp/clk-of-pxa1928.c +++ b/drivers/clk/mmp/clk-of-pxa1928.c @@ -216,6 +216,7 @@ static void __init pxa1928_mpmu_clk_init(struct device_node *np) pxa_unit->mpmu_base = of_iomap(np, 0); if (!pxa_unit->mpmu_base) { pr_err("failed to map mpmu registers\n"); + kfree(pxa_unit); return; } @@ -234,6 +235,7 @@ static void __init pxa1928_apmu_clk_init(struct device_node *np) pxa_unit->apmu_base = of_iomap(np, 0); if (!pxa_unit->apmu_base) { pr_err("failed to map apmu registers\n"); + kfree(pxa_unit); return; } @@ -254,6 +256,7 @@ static void __init pxa1928_apbc_clk_init(struct device_node *np) pxa_unit->apbc_base = of_iomap(np, 0); if (!pxa_unit->apbc_base) { pr_err("failed to map apbc registers\n"); + kfree(pxa_unit); return; }