From patchwork Wed May 1 05:04:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 16551 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2113225E01 for ; Wed, 1 May 2013 05:05:03 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id l18sf1505631wgh.11 for ; Tue, 30 Apr 2013 22:04:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=UpUYns3tW1gwDxZO8eBYgkpo1qytUb5XKmP/qILdY4g=; b=Kmva6+wNlYZ3kMoRizRxPpIzB69P/RECvQKk7Bag2CwgMEKDNuNxDM2xAlt13l95zT FNCvw98iCqfnsUpqe0VhAaEggN7nw68IDA9Li26zIg3MMjA8l6eNMSJt1ytg0eYLVz+a qzw7PkUoo9P4mS6dacD9aTZ87hJoQQSoKcStMBW0bACTIvOSyByT2PI7m/qSRLHQQoXB hCu6AvnrTZNhOo2jy2AJJKGxqkZp6Ofqzlx4BunXBr8TOxEPvTyNfOnUe53ObT+TGGVp aCd6AwjvbKs8EePUwyfd43bPU+RMU7DcP67kwn8d7Z7dErN8GPa/cK10MKds0Pb8lfVl GOTg== X-Received: by 10.180.87.193 with SMTP id ba1mr13052078wib.0.1367384697808; Tue, 30 Apr 2013 22:04:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.184.46 with SMTP id er14ls374988wic.12.gmail; Tue, 30 Apr 2013 22:04:57 -0700 (PDT) X-Received: by 10.194.63.239 with SMTP id j15mr1191965wjs.30.1367384697726; Tue, 30 Apr 2013 22:04:57 -0700 (PDT) Received: from mail-ve0-x231.google.com (mail-ve0-x231.google.com [2607:f8b0:400c:c01::231]) by mx.google.com with ESMTPS id j2si411276wiv.83.2013.04.30.22.04.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Apr 2013 22:04:57 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::231 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::231; Received: by mail-ve0-f177.google.com with SMTP id cy12so999821veb.8 for ; Tue, 30 Apr 2013 22:04:56 -0700 (PDT) X-Received: by 10.220.242.73 with SMTP id lh9mr431010vcb.49.1367384696636; Tue, 30 Apr 2013 22:04:56 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp137688veb; Tue, 30 Apr 2013 22:04:56 -0700 (PDT) X-Received: by 10.66.121.202 with SMTP id lm10mr3129395pab.138.1367384695537; Tue, 30 Apr 2013 22:04:55 -0700 (PDT) Received: from mail-pb0-x231.google.com (mail-pb0-x231.google.com [2607:f8b0:400e:c01::231]) by mx.google.com with ESMTPS id zm10si1342746pbc.328.2013.04.30.22.04.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Apr 2013 22:04:55 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c01::231 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=2607:f8b0:400e:c01::231; Received: by mail-pb0-f49.google.com with SMTP id rp8so598040pbb.36 for ; Tue, 30 Apr 2013 22:04:55 -0700 (PDT) X-Received: by 10.68.13.228 with SMTP id k4mr2162467pbc.215.1367384695021; Tue, 30 Apr 2013 22:04:55 -0700 (PDT) Received: from localhost ([122.167.112.160]) by mx.google.com with ESMTPSA id j13sm2090824pat.17.2013.04.30.22.04.49 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 30 Apr 2013 22:04:54 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com, arvind.chauhan@arm.com, shawn.guo@linaro.org, nm@ti.com, Viresh Kumar Subject: [PATCH] cpufreq: cpu0: Free parent node for error cases Date: Wed, 1 May 2013 10:34:43 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e X-Gm-Message-State: ALoCoQmNAGam+mjCdaBvhsah34z+YAL3oNOTQB2K/MRXpxTV8Ikd/8v0PIqo79lkkv0zgsSovdtW X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::231 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , We are freeing parent node in success cases but not in failure cases. Lets do it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq-cpu0.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index 3ab8294..c025714 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -189,7 +189,8 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) if (!np) { pr_err("failed to find cpu0 node\n"); - return -ENOENT; + ret = -ENOENT; + goto out_put_parent; } cpu_dev = &pdev->dev; @@ -199,7 +200,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) if (IS_ERR(cpu_clk)) { ret = PTR_ERR(cpu_clk); pr_err("failed to get cpu0 clock: %d\n", ret); - goto out_put_node; + goto out_put_np; } cpu_reg = devm_regulator_get(cpu_dev, "cpu0"); @@ -211,13 +212,13 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) ret = of_init_opp_table(cpu_dev); if (ret) { pr_err("failed to init OPP table: %d\n", ret); - goto out_put_node; + goto out_put_np; } ret = opp_init_cpufreq_table(cpu_dev, &freq_table); if (ret) { pr_err("failed to init cpufreq table: %d\n", ret); - goto out_put_node; + goto out_put_np; } of_property_read_u32(np, "voltage-tolerance", &voltage_tolerance); @@ -262,8 +263,10 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) out_free_table: opp_free_cpufreq_table(cpu_dev, &freq_table); -out_put_node: +out_put_np: of_node_put(np); +out_put_parent: + of_node_put(parent); return ret; }