Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2652369imj; Mon, 11 Feb 2019 06:30:27 -0800 (PST) X-Google-Smtp-Source: AHgI3IaACJnZLlAT0GizvLo510M1EZW3AytxKH61fkTdeUcC65sXbCMpw1rFnAoCmo8S56oLRGCT X-Received: by 2002:a17:902:1a2:: with SMTP id b31mr38136840plb.87.1549895427054; Mon, 11 Feb 2019 06:30:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895427; cv=none; d=google.com; s=arc-20160816; b=Ssl74D//qfD4UqlFmtCSSeS5BYjWW+grLigsYPtGxuMBs53V7flWXglCCC1BRb2rY9 pl7cPrbUXHGJoN2DsutFRb4x3Rd9LJyt38NpVoMGXFrt8ORdP+NqsbFaFEFXr8GDXY30 E1S3iC+U3J2k0axrsJ3VSF7vnNoEunsf6PkOSTaoj9cxFjjWLP3PHQjASNJD4sjyyeLn wKmlf3czKSpsO8JizrpUYq5Z7LiNtBAu9z/K0YqALqfWqCFOutIdITi/Hm5j5osC9pGr 9rLPbDehFRDACVfBCcFJ5npoVYlCZw+SoA7eDb/YSXx//0jVUzB90dxuKp8MZ29AhP+t OtPw== 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=smR+9pghvBStSXHDWku/n0SnrBoSTdj8QlzGoI90t1I=; b=V1VG92ZgCuzpHWHuDe0AxBp+8p7x8EqMbVwQg+65kd0iMuIP3XMqRflEhlwd+oNP2M xcLtOyYB23EQsMMygc340xQTSlwT2XM/dgmYV6FtECccQLebz108GJqjcDHcCr0te9kW KSsOf8z4vZVenrwtnpOs5Xmi628aSZT72oaKObFwKTTI10Fjxqzd9IFXKrjufnwPpr1I FLC0Yd83+tpRJN6zpzbRWaIgXuPfdbLDeX8hHKZ+nlNpoj5mCu+wVtkAe9xdhOos/8MU v3n4QeV4WnmahNzR4Gihjtiy+LtB6Dc/736ISxoLbAhP+FSlwB2Binj7ketF48VKX9MD 4h5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ewNExTv3; 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 j14si7802786pgg.44.2019.02.11.06.30.09; Mon, 11 Feb 2019 06:30:27 -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=ewNExTv3; 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 S1729985AbfBKO3Y (ORCPT + 99 others); Mon, 11 Feb 2019 09:29:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:35420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729402AbfBKO3V (ORCPT ); Mon, 11 Feb 2019 09:29:21 -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 E31B72075C; Mon, 11 Feb 2019 14:29:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895360; bh=dJlfe+3lta2a7a/4plFiuLIbRxJZ8qyTaIExk/eTsrk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ewNExTv3ti/s4wUiZt24UUmd9ommhYCj9TV/JIjj2Je42q4OhVeX6YeLloq2MZOKS 4KwDGzARIFmBcywEg8ZCQ1q/TctmbiHtxJ/Z91FntECrOevjpHTr5tpwq8da1Nesvg wYJ7jDlL2/bHOSn6KlPfNxp0HsRw1Mfrl/BIuBC4= 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.20 148/352] cpuidle: big.LITTLE: fix refcount leak Date: Mon, 11 Feb 2019 15:16:15 +0100 Message-Id: <20190211141856.053032048@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@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.20-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