Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2682583imj; Mon, 11 Feb 2019 06:59:33 -0800 (PST) X-Google-Smtp-Source: AHgI3IbOQXxxxgNZ5+5ISXLuMaTgq4hYWhbZJ49uRQyXI9KLLnvCVmh66huBnqQfGwCV4090NnzO X-Received: by 2002:a17:902:7202:: with SMTP id ba2mr11117872plb.147.1549897173427; Mon, 11 Feb 2019 06:59:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549897173; cv=none; d=google.com; s=arc-20160816; b=x9k5ueas6IzuyJh0tjE7lVkq3T2c8rAYZ2U/NSyrvEphuQnSjGL4CsvppoXYWa+RTK mK/B7CvufjV0qHaFQHczvW5kuU//6v4ALV+zzIz4BEb8mxN9JrFuhlUohQlxFM5ntvPS 45pzXMIGy3P6drTlklhV+FnBMZMMGhmq7mHhqTUAaDCYxkYi9L15OOxdK6uiTa5i3k2B wZEBNn73Lr/qqxxMjDb9tUwRG7lj+5P1LGlG6q4PhwuzRggZ7263QHbe0oOz1B1GX0Wg Hv84VLRu56homJ3qrRn8xhZJ50F0W0BPcSc6NmLLf9muPeJ/djuEsWray9Rl4N6+/Kas ZtGg== 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=LDoamhp71O9bQmF2m98QGKxz7ce41hbMiiziybyLH2Y=; b=ay9FoSIMlt85IyZ0DEayvjlkfMTQpjRzNMkmCeIEXT9Nqoc1gGZ9qS8npVXv8Gsjs1 h2P3KiNxlOsWDe9WCahvAYzx10qMYhRpx6UAqNcxlaIXG3BZOiXvtf8o+Eu7qerz4539 yK001oXpt/s+vd3mUhszweg/I5CfmH2RUalRmjfJlQfMO4HZVp5eFer9e8Z6NQpyNh1F NTlg7rGstTB4hXw9UEH1pN1NT7zUlzdIVSewmmyBE26YicRHiyoL2h2lt0aVLGCrTrJE EGGeg/Bq9X4+OgwOUI7c6id3t5qml6MIvASt6XdLoHI0VfpB7FDVdWZG5a15gt6UoL45 0Www== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wc02HO00; 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 n5si9844296pgh.422.2019.02.11.06.59.17; Mon, 11 Feb 2019 06:59:33 -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=wc02HO00; 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 S2389536AbfBKO6Y (ORCPT + 99 others); Mon, 11 Feb 2019 09:58:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:45992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389525AbfBKO6X (ORCPT ); Mon, 11 Feb 2019 09:58:23 -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 A10292229E; Mon, 11 Feb 2019 14:58:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897102; bh=OlU2JJltDBM+N2+6Sag/5GlCAX4SxFjJ/3yOni+hikI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wc02HO00tTg0rf0sOiJAqkYMlbzNUyMu2YR0ZMXDfB3Hfm90kYxfH00+va27M7WvB SJtcYJ8Yag+T2oFeiIDDhV5X64uDZybGpI0zno/xvsgNW8W1GsDe34TuMyYLYrwGgP OjqAlIdYc+G/hWaC0izHrXjiP5hCrMt03XjRFE9Y= 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.14 084/205] cpuidle: big.LITTLE: fix refcount leak Date: Mon, 11 Feb 2019 15:18:02 +0100 Message-Id: <20190211141834.189259844@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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