From patchwork Mon Feb 17 09:03:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 24742 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9AD0C202B2 for ; Mon, 17 Feb 2014 09:10:39 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id m1sf63202590oag.5 for ; Mon, 17 Feb 2014 01:10:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=3dNKnFjGWV0NZa+OD9Rvy6D3D6JPoWo/1d8HiQBMx70=; b=Cbk8Yi7QyyVbZjDfMVvz0wOM3N3TiFVrGQ2tfYfzVWR02A2qelENFY459YntY5STdK 5d7Rqq7CBUJYyFLQ6BTTnABGxgeJTRPV8oVzuSlTj7XFj7iUytS6j2bAJv/XbZLY5xHN oGM5lPHP/RAt05XPouUPeOzQjlzTRrqtvEZZRl5ndTaqlnN4DDmfRDghB/fm1t0mQl6X +IMx41iRb3OAyH9q++x+zAC5Z0bJXy4f+KblaTOH20fWcMsUoeGKLKMFk8n033r7ilOT BrmBQz0xTBNTNZIzsjWLmC5Qmy6D0eqX+ZfDN7KIaogg1P6avp33CFsJSc/HhuFqgHUl RBOw== X-Gm-Message-State: ALoCoQkjPR0lycmuKbd2ekWtYxfShmI6zuttex05nLXWTMvDHBo/SjAxkzukVmLPAxuoLqG+maRx X-Received: by 10.182.19.231 with SMTP id i7mr10134636obe.25.1392628238729; Mon, 17 Feb 2014 01:10:38 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.35.208 with SMTP id n74ls824549qgn.65.gmail; Mon, 17 Feb 2014 01:10:38 -0800 (PST) X-Received: by 10.220.106.84 with SMTP id w20mr16357718vco.18.1392628238622; Mon, 17 Feb 2014 01:10:38 -0800 (PST) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id eo4si4325904vdb.121.2014.02.17.01.10.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 01:10:38 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.181 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.181; Received: by mail-vc0-f181.google.com with SMTP id ie18so11164282vcb.26 for ; Mon, 17 Feb 2014 01:10:38 -0800 (PST) X-Received: by 10.52.104.68 with SMTP id gc4mr13549229vdb.2.1392628238537; Mon, 17 Feb 2014 01:10:38 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp122783vcz; Mon, 17 Feb 2014 01:10:38 -0800 (PST) X-Received: by 10.66.122.201 with SMTP id lu9mr25010284pab.40.1392628237768; Mon, 17 Feb 2014 01:10:37 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pp3si13117702pbb.349.2014.02.17.01.10.37; Mon, 17 Feb 2014 01:10:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752777AbaBQJK3 (ORCPT + 27 others); Mon, 17 Feb 2014 04:10:29 -0500 Received: from mail-pd0-f177.google.com ([209.85.192.177]:37630 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752375AbaBQJJS (ORCPT ); Mon, 17 Feb 2014 04:09:18 -0500 Received: by mail-pd0-f177.google.com with SMTP id x10so14462854pdj.8 for ; Mon, 17 Feb 2014 01:09:18 -0800 (PST) X-Received: by 10.66.121.68 with SMTP id li4mr25461556pab.33.1392628158495; Mon, 17 Feb 2014 01:09:18 -0800 (PST) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id ug2sm112608647pac.21.2014.02.17.01.09.15 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 01:09:17 -0800 (PST) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: broonie@kernel.org, lgirdwood@gmail.com, sachin.kamat@linaro.org Subject: [PATCH 7/9] regulator: max8998: Add missing of_node_put Date: Mon, 17 Feb 2014 14:33:35 +0530 Message-Id: <1392627817-26957-7-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392627817-26957-1-git-send-email-sachin.kamat@linaro.org> References: <1392627817-26957-1-git-send-email-sachin.kamat@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add of_node_put to decrement the ref count. Signed-off-by: Sachin Kamat --- drivers/regulator/max8998.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/max8998.c b/drivers/regulator/max8998.c index ae3f0656feb0..ce22d4f3f3eb 100644 --- a/drivers/regulator/max8998.c +++ b/drivers/regulator/max8998.c @@ -674,8 +674,10 @@ static int max8998_pmic_dt_parse_pdata(struct max8998_dev *iodev, rdata = devm_kzalloc(iodev->dev, sizeof(*rdata) * pdata->num_regulators, GFP_KERNEL); - if (!rdata) + if (!rdata) { + of_node_put(regulators_np); return -ENOMEM; + } pdata->regulators = rdata; for (i = 0; i < ARRAY_SIZE(regulators); ++i) { @@ -692,6 +694,9 @@ static int max8998_pmic_dt_parse_pdata(struct max8998_dev *iodev, } pdata->num_regulators = rdata - pdata->regulators; + of_node_put(reg_np); + of_node_put(regulators_np); + ret = max8998_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np); if (ret) return -EINVAL;