From patchwork Fri May 3 04:44:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 16610 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 643C2238EC for ; Fri, 3 May 2013 04:44:45 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id p14sf2158243vbm.6 for ; Thu, 02 May 2013 21:44:36 -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=Q7PFOHbpzjy8HolwaOM/+dVTXRTwKkeVXiTKN5Ibvlk=; b=eijcvxOil0ssHxSnthQ1T1O4KkdkGHXMZw3heEJdgP2sG2uOfoysSJ1tdSBvaKQYHZ /73y0onKgiziXB0+Fm8LVUL+sEZz84zs30Ytis+KBzT32NnVB9UOlL9tIPQKFXbyLhS5 FCE9vUpdliqmR8xjAcMOOBOl93UGPuRXYQbNV4OgJJSjBJhZGnF0uZ0YRV3THTVwW++y kscdixogvLUEDgIR5ZaxBMq6sQS2zHaar+aXkOaSv9EFGVezdyXjpMvdCZ4EEv/E+BOE 8pk1pbnWHscVDsYh+Y4W87OgnAWBeK2M64PnroXR9A192r5QMcoLOejRe52ygEtEJX5h GtWg== X-Received: by 10.236.151.133 with SMTP id b5mr1309768yhk.49.1367556276431; Thu, 02 May 2013 21:44:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.109.105 with SMTP id hr9ls1494713qeb.6.gmail; Thu, 02 May 2013 21:44:36 -0700 (PDT) X-Received: by 10.58.50.7 with SMTP id y7mr3194261ven.24.1367556276280; Thu, 02 May 2013 21:44:36 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id q13si4417425vcw.36.2013.05.02.21.44.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 May 2013 21:44:36 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id hx10so1135135vcb.17 for ; Thu, 02 May 2013 21:44:36 -0700 (PDT) X-Received: by 10.220.242.73 with SMTP id lh9mr3119851vcb.49.1367556276078; Thu, 02 May 2013 21:44:36 -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 nf2csp5122veb; Thu, 2 May 2013 21:44:35 -0700 (PDT) X-Received: by 10.68.226.230 with SMTP id rv6mr12144078pbc.55.1367556274948; Thu, 02 May 2013 21:44:34 -0700 (PDT) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by mx.google.com with ESMTPS id rr3si6270169pbc.122.2013.05.02.21.44.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 May 2013 21:44:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.178 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.178; Received: by mail-pd0-f178.google.com with SMTP id w11so716459pde.9 for ; Thu, 02 May 2013 21:44:34 -0700 (PDT) X-Received: by 10.66.151.142 with SMTP id uq14mr13215768pab.50.1367556274296; Thu, 02 May 2013 21:44:34 -0700 (PDT) Received: from localhost ([122.167.220.195]) by mx.google.com with ESMTPSA id br2sm10002302pbc.46.2013.05.02.21.44.29 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 02 May 2013 21:44:33 -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, Viresh Kumar Subject: [PATCH V2] cpufreq: cpu0: Free parent node for error cases Date: Fri, 3 May 2013 10:14:25 +0530 Message-Id: <03c6b0e0f41238c1b4346b4186040ff69e369b4a.1367556239.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e X-Gm-Message-State: ALoCoQm+PX136s+uqSwqhj+gqdrha49Jljeyi0bwFtdWpc9VKkO/2yPi9rXBBELSMfvCjwFlrDNB X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.172 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 Acked-by: Shawn Guo --- drivers/cpufreq/cpufreq-cpu0.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index 3ab8294..8565d41 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; @@ -264,6 +265,8 @@ out_free_table: opp_free_cpufreq_table(cpu_dev, &freq_table); out_put_node: of_node_put(np); +out_put_parent: + of_node_put(parent); return ret; }