From patchwork Tue Nov 28 06:51:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 119794 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp2738094edl; Mon, 27 Nov 2017 22:51:44 -0800 (PST) X-Google-Smtp-Source: AGs4zMapv/ibMNJUrcjOHk7916pwG5ARoyRcztvFgjgQfz2J7mfiUYbDVieWgMfacdzpE8Sw7GNc X-Received: by 10.101.100.215 with SMTP id t23mr14156787pgv.433.1511851904290; Mon, 27 Nov 2017 22:51:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511851904; cv=none; d=google.com; s=arc-20160816; b=mQJ8yJW31yT5uwwYa98eRs7egitKCd0xFjY+ALXLXeKuVi/1nmXEbCHGZWz18kURQ/ 0ocJM97JgMxOvypG1JdyZa5FszvnErWBgrLd2nhXtHclIgK1KsG4hTW5QBgO5s13ZZxH IaKNJbxwQRUju+gd8MMDPY98bG/wCpmG1tT0gf5Lcv1WUcPtDLld3cJz4l5D4Tnm7bos m9KnMANzLTzqlf5RKAlUhFOvY8kLyv4QgmN+8whgIoi2wxkmu2KFsDPTo+eypbgpXme0 JGDkuNuPq33HO9lcUfrRJFPm+1Co+9XrkmSIoS9J2iiaIFzE5qvEGfpTD8CbnVpi2z93 JudQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=aiddccDqqWJDpW05Ve2RHswyxtGZTyJDCHzVd0xaMng=; b=pgyIPB7Ro+cuAngNsyuckGR33+DK/Cn2QxVCjp/o3JsZ5At1qpWb1u4eR8EUlLoJZU 9KOHHrTAdft64jIdtpWqNH2KsHGdSH/R21pRWoEWnn4y5at16Mvuu7MHMSJoi7zt4kVR Qzxgc5e1K8tKULDL4qdxUd/KKm052H24x3sSc/etIFcXkP0ZMeCOGczTaRoMR9O+OTwg 6t+QUlyMkM036r2mzgBXTSKqU1lOBZNDd8f+hlOHMpsxCKG2kInEHd7Gjv6wcltpCZlt p648p34U3R5WMscFAZ8dLd9tj48T2pGGS9wGQe7auRwmwQYZUnz6IiMEFajl6KH6IFHM rUpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cRVhR4gE; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x32si19248518pld.64.2017.11.27.22.51.44; Mon, 27 Nov 2017 22:51:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cRVhR4gE; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751318AbdK1Gvn (ORCPT + 9 others); Tue, 28 Nov 2017 01:51:43 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:46402 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751256AbdK1Gvn (ORCPT ); Tue, 28 Nov 2017 01:51:43 -0500 Received: by mail-pf0-f196.google.com with SMTP id q4so18525716pfg.13 for ; Mon, 27 Nov 2017 22:51:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=aiddccDqqWJDpW05Ve2RHswyxtGZTyJDCHzVd0xaMng=; b=cRVhR4gE4s/NBZfXjOoSTywasHwtJ5hytA3PhWVA9tH6r7ppVwe3uOzaZZSCGjOKtQ cNhx5jKvpHyyEAk7cwBQI1jVaF/ymJvQfRsSvK/gk+HsPa2Mj09GJeacbZwJ5xcY5owQ /l2FvO0uGmR8prjIsMknfSfrUhO0P3RwkNutE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=aiddccDqqWJDpW05Ve2RHswyxtGZTyJDCHzVd0xaMng=; b=dFpfUG1V/bWNsHoM4B6h3fC8332H/m/vDJatv66RTXbPSFwXXO1m2AmOz6/3HCx2u5 if9LG7X02toyIXwfdCOCXt7AUvoEMNqkiS+hgKJ2hhtrcW593S08hQzAe+e4DkbmDF+Y mBmZXIToM9jVZ/EX/kekxhK2Z/mikuZrwHBuc8RMWKuQIricwKnL3B9srd3zZfY24dQl uy4yaUjCC2rxKaqYji/fAx1a1dcxB+L/H8zYNmzcOEEjPDmOH0me19Ln6O2aHqVzSBHG I0yiVvTiTm24VuzIEJ2q9HRnLuPy9ZJ9ALl5tfOzghlNISUuGN8aPlGkytDLiC3WWLeC RWqg== X-Gm-Message-State: AJaThX4a9PsbQm3hbrB45M5t0SQnkOXxYDPQ85ov9xXfDhbR9J6ulTc0 ESRug3NOKDujffy8h3tOC5um9Ud80TQ= X-Received: by 10.98.200.20 with SMTP id z20mr39630674pff.108.1511851902414; Mon, 27 Nov 2017 22:51:42 -0800 (PST) Received: from localhost ([122.171.67.58]) by smtp.gmail.com with ESMTPSA id f83sm58356135pfj.23.2017.11.27.22.51.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Nov 2017 22:51:41 -0800 (PST) From: Viresh Kumar To: stable@vger.kernel.org Cc: Viresh Kumar , linux-pm@vger.kernel.org Subject: [PATCH v4.9] PM / OPP: Add missing of_node_put(np) Date: Tue, 28 Nov 2017 12:21:38 +0530 Message-Id: X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tobias Jordan commit 7978db344719dab1e56d05e6fc04aaaddcde0a5e upstream. The for_each_available_child_of_node() loop in _of_add_opp_table_v2() doesn't drop the reference to "np" on errors. Fix that. Fixes: 274659029c9d (PM / OPP: Add support to parse "operating-points-v2" bindings) Cc: 4.9 # 4.9 Signed-off-by: Tobias Jordan [ VK: Improved commit log. ] Signed-off-by: Viresh Kumar Reviewed-by: Stephen Boyd Signed-off-by: Rafael J. Wysocki --- drivers/base/power/opp/of.c | 1 + 1 file changed, 1 insertion(+) -- 2.15.0.194.g9af6a3dea062 diff --git a/drivers/base/power/opp/of.c b/drivers/base/power/opp/of.c index 5552211e6fcd..af208884bbed 100644 --- a/drivers/base/power/opp/of.c +++ b/drivers/base/power/opp/of.c @@ -348,6 +348,7 @@ static int _of_add_opp_table_v2(struct device *dev, struct device_node *opp_np) if (ret) { dev_err(dev, "%s: Failed to add OPP, %d\n", __func__, ret); + of_node_put(np); goto free_table; } }