From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3305BC282CE for ; Mon, 11 Feb 2019 15:43:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EEBF3222A8 for ; Mon, 11 Feb 2019 15:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549899795; bh=Zj4+VN2jH9EdrJIa+L80D/uH3xK5Z9w9uM2VQUVYoi8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ltvqac7udNfoUDnQI7y0vKKeSB0xwxEbxsh99Nv65yCFbwhSsxLtmCYUaooWLgncu iG09IiGv0qlj2w0mYTJMKsykyPfOoifvaiR73CdVT0RFuj+VDRC7W2Uyuvm2rUnBjl gce0wcgA2RJZ3hb2UE8DTMdsgsBG0BM6C37yvTyI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732613AbfBKOpx (ORCPT ); Mon, 11 Feb 2019 09:45:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:58998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732417AbfBKOpw (ORCPT ); Mon, 11 Feb 2019 09:45:52 -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 66901206BA; Mon, 11 Feb 2019 14:45:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549896351; bh=Zj4+VN2jH9EdrJIa+L80D/uH3xK5Z9w9uM2VQUVYoi8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xe20FaZXJenG9R/LcZT+STwxiB2HjdISLzmu7KuCJP7JDqAM/iepSyoNJLu6f68VX HEJMvnB5QTEwCktv8WSl1TMre8La9sP4syXHn/JthjSYkn3nJHX8Xq2J+qic+aI9ze AbMrnrNx8w5vZQYPa4NJk2lNZaHjJpqgIxZjbd2U= 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.19 126/313] cpuidle: big.LITTLE: fix refcount leak Date: Mon, 11 Feb 2019 15:16:46 +0100 Message-Id: <20190211141902.184054962@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141852.749630980@linuxfoundation.org> References: <20190211141852.749630980@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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 4.19-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