Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2434603imj; Mon, 18 Feb 2019 06:03:01 -0800 (PST) X-Google-Smtp-Source: AHgI3IZTRvzy6BB2WDB2PmuTRFbEAkM7RMtyNWoT3hp03l43vMcbFzyS0JOFcEquNDluI5Jbpm2t X-Received: by 2002:a65:5003:: with SMTP id f3mr19197321pgo.39.1550498581352; Mon, 18 Feb 2019 06:03:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550498581; cv=none; d=google.com; s=arc-20160816; b=kEi186Xn8Sckb3A9Mm00I1SQ79O1vNzajCQSSxQMIvdCBAK4nu5HzhmIQASW+Sg8lx sVzHE2qW9O7tWBYCmr6G50/TV5Sp40bmIVAHoXab+/iBWvTbpjIUhWPqdkerT2OInjjd nDwyagoYJKNOUzAZ2gr1gAymjEhvwZd2xEU5uRQiYH5+x8+fYgOjx+pMrxY3WiyzJxRH QjVQfHVquPICiI/C50yct71TRmwQaS5JRJNQcqRS9RWpXH6TtKZdGHW/vBg+4IK4Cp3i VM/MBPnTD2ZsJK4cv15J8wlVFIUpdRAWVqF8husIfY/Z8ncjfwV073fmLRXX+bYwjI1A DGFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NWp7sgyZt7hgZF4Qa50NGBdrHvVFI3FiNGCn6cvm5kI=; b=toDltIbhO5csqJ0jSebvHjqh4zFzkO7wixbgj+fs8PqVqr6ZD9DJrinOB9ilyYbY6x Oj3Ld0OFYTERMIwpIrSqQ159XWy2+FNSW3o5w4Vur/6QfUm054drC6zK2UzjGZ4meX+/ W98vGf00edZMXTFW2Ce8BRsjHGTjJcRcouPcfplifmRW3UKJ8QNf2vCvrW01CFjj9pZ/ /YvnBX5GtajesmpUCRZ0dCjGeOgAWonzg+4XCNc/c6BGp9nIp5Q4MxTAf3W5gNiyA8Vz ZgNkX9b51/QRD9F2NbZlEppJywyv/f5uZgnLpl99Qrh8FtS1X8Vg7ftaZk8e/9gSRxOx lVtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ci/793jM"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si13148021pgc.365.2019.02.18.06.02.45; Mon, 18 Feb 2019 06:03:01 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ci/793jM"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731654AbfBROBz (ORCPT + 99 others); Mon, 18 Feb 2019 09:01:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:43442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389184AbfBROBx (ORCPT ); Mon, 18 Feb 2019 09:01:53 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5F31A2173C; Mon, 18 Feb 2019 14:01:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498512; bh=Mc1Q5Htk+2Z8WtC2Vo6DGz5MOoqU7GfgI529GswZYp0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ci/793jMEH9zgsrWcjWfxKJ9hhGbnAJmkabms9A3wP2mTUZ0TMbIyvBj260NP4Tab UGiqS3bnCwwe8f51a9HC94wHgbsIQwHvYvNYzO0voaOBlEiStJvU/BU92ozWadMPXb A+koZV08sre1w8YJr+sAsh+toJ4apq3/tM34KBWU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yangtao Li , Daniel Lezcano , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.4 033/143] cpuidle: big.LITTLE: fix refcount leak Date: Mon, 18 Feb 2019 14:42:41 +0100 Message-Id: <20190218133530.347032435@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133529.099444112@linuxfoundation.org> References: <20190218133529.099444112@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 9456823c842f346c74265fcd98d008d87a7eb6f5 ] of_find_node_by_path() acquires a reference to the node returned by it and that reference needs to be dropped by its caller. bl_idle_init() doesn't do that, so fix it. Signed-off-by: Yangtao Li Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/cpuidle/cpuidle-big_little.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/cpuidle/cpuidle-big_little.c b/drivers/cpuidle/cpuidle-big_little.c index db2ede565f1a..b44476a1b7ad 100644 --- a/drivers/cpuidle/cpuidle-big_little.c +++ b/drivers/cpuidle/cpuidle-big_little.c @@ -167,6 +167,7 @@ static int __init bl_idle_init(void) { int ret; struct device_node *root = of_find_node_by_path("/"); + const struct of_device_id *match_id; if (!root) return -ENODEV; @@ -174,7 +175,11 @@ static int __init bl_idle_init(void) /* * Initialize the driver just for a compliant set of machines */ - if (!of_match_node(compatible_machine_match, root)) + match_id = of_match_node(compatible_machine_match, root); + + of_node_put(root); + + if (!match_id) return -ENODEV; if (!mcpm_is_available()) -- 2.19.1