From patchwork Tue Nov 28 06:50:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 119793 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp2737405edl; Mon, 27 Nov 2017 22:50:56 -0800 (PST) X-Google-Smtp-Source: AGs4zMZuKnXbuFEwRqOJytoFnXBA3Ju1j6GOurjLU5zVit/a6kwJOzxBuXst377UFY3xPi0xOSII X-Received: by 10.98.60.27 with SMTP id j27mr39688194pfa.68.1511851856062; Mon, 27 Nov 2017 22:50:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511851856; cv=none; d=google.com; s=arc-20160816; b=JVT26HchUu5qytFvX+YMghAMIFKO2m/M69Q/L7PJHwK7GVXLIVkEpCqAFOhh+yMsvr dEFHVu7ntk01s/d1dyckStXM7qjG00DDiGoVi7YsenYYeScK8O8Kbfmkb47ECarqAgKG CnWXhw+tGNdRYt/iuUbSCDypnj9d4xPKQ67LHVCUHTyLwLzJzBNxS25VJ1pjAejkvUGu Y/5BSXXq4YxQWzSmiaUex6SLs8/xAGPcD1AuSHD30sPYsnSHEScFI7ITQDJBpIScfvnG dEqBH0u+6DucdXDQJJpRzXLJkkpd0Uj+cDIpTwhZqJNEHNALjxIyUXRrUHjdesYn1HQi RGmQ== 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=ly0bB/rw4xdDBWbXgqHrn5lZFC52L+qlOGWl4C/XUxM=; b=fqyP/rQq51SF0NkZ8DjaCc2sOwjPkqsjncm5dIuUxDHGp3RikE5ihCtZKQ8FLwj1QF Ivobiq3NsCEYyml1FhsxunUh45bZsy66ajopP1+x+LnZH7R1TWXHx6S9QP1fgrl5RHpM /z7GupzF3BYEBsi6XuWDIuBnKTO6/jwpwPAEIkbeW5ypfmaO4/bumNzs64wCgLvbRGCY 3ATlcysAa/pLX8omRI3Y28b5y9u+x3HvcNPyWxHrrH4iftjDkRVdeQSr8Q9+Iu3a0q9e nWaIwe2a8LGbKJpGt0CgbLNfd8Gf77fJW0XE7qnkx+OFziZCLZHWD66ZH4ELPan2kShX K8lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jFWuOonc; 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.50.55; Mon, 27 Nov 2017 22:50:56 -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=jFWuOonc; 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 S1751713AbdK1Guy (ORCPT + 9 others); Tue, 28 Nov 2017 01:50:54 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:38352 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750933AbdK1Gux (ORCPT ); Tue, 28 Nov 2017 01:50:53 -0500 Received: by mail-pg0-f68.google.com with SMTP id s11so19878529pgc.5 for ; Mon, 27 Nov 2017 22:50:53 -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=ly0bB/rw4xdDBWbXgqHrn5lZFC52L+qlOGWl4C/XUxM=; b=jFWuOoncPuavLzb5MnhkECnc0L+kj81a5D5EqB086qUcbGchHLhLELAYvwc7BKukRB du5gcOVNgBPYMogvYj2QMn0A29U7HwyeWwCfp5rOrbjeteIus8k1ABoSIQcMZl3S2HYC AhHHHEBKso110QEjL1h5HQVienuut5yNYa4fw= 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=ly0bB/rw4xdDBWbXgqHrn5lZFC52L+qlOGWl4C/XUxM=; b=U8jY9kXNLKf+qXDSr9DMM936hx5OyG79CdQRusdLJKhEb7N5Xi4y6sQdbWA0+7X1+E mTUIzxP/S+YWbvrzAiKXUKL9mtlH47bt090g+PNsQM9PrMs9bJweLwwBBYZZnU0+FunT moyzllRdm9LRVhg95uEOEX6gguXlHUxNwxcmvL92U1wizngBIC4dxhRGznUylH+8OCP6 kwVx1caqsGo1hfS+fX9btPFiZp5L7BedDVCVCpOePMIiSFCWedNcsDiWXTY/ktRq2S/0 +SMKkAF40c06JP6tYV3x6DWDfYaj1wIgt7uhpQZ9jO+bCnXHGaa9gsc7dYiJZQzltp19 B5Kw== X-Gm-Message-State: AJaThX4WNme4c6vPrAhhZKn+u5nXOUzaTcL+hWfUOxRFaxiAL3o3iO2q Fz224pHUjvmDeuhiT+Tq1nlIDyqmTjQ= X-Received: by 10.99.189.10 with SMTP id a10mr9426921pgf.350.1511851852921; Mon, 27 Nov 2017 22:50:52 -0800 (PST) Received: from localhost ([122.171.67.58]) by smtp.gmail.com with ESMTPSA id t62sm26972792pgt.23.2017.11.27.22.50.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Nov 2017 22:50:51 -0800 (PST) From: Viresh Kumar To: stable@vger.kernel.org Cc: Viresh Kumar , linux-pm@vger.kernel.org Subject: [PATCH v4.4] PM / OPP: Add missing of_node_put(np) Date: Tue, 28 Nov 2017 12:20:41 +0530 Message-Id: <3b71eca9ceb96a3525f4bb08bd1225536d691638.1511851763.git.viresh.kumar@linaro.org> 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.4 # 4.4 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/core.c | 1 + 1 file changed, 1 insertion(+) -- 2.15.0.194.g9af6a3dea062 diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c index b8e76f75073b..0b4190a1efaa 100644 --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c @@ -1199,6 +1199,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; } }