Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3702935imu; Mon, 28 Jan 2019 09:18:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN7vZ00Uye9T8pN9QjIsRFT822DNaV0reBuRZWuQaPgwzuSHCEvbRQPeLC8msuTIJKV5Wznn X-Received: by 2002:a62:6e07:: with SMTP id j7mr23269327pfc.135.1548695891860; Mon, 28 Jan 2019 09:18:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548695891; cv=none; d=google.com; s=arc-20160816; b=FXX6Xo2UPuX7MZj7LSQQv+Tu3KJQM3vqDd34sTF86taiCaInXwYm/oKpcvbhbUyyXG nc/AFBBLIdJ22D0ZTVR+g7QqeW/rCpbv+Wjo5lmS5UnKaUBcQlWwCJ0oq9riA2/A+Dg+ X1z15nUZ7Q46xl7IGiSA3+T8F2YEaC1CpdgeCUW8de0JUKFMJ5Q8001biqgktgvUfYoJ 6dcvadqelFhgdHVmSrHCowVirGV/KGL1qAzqtb67oT9xpVABoDXWl2HVfQvipa0gI4sy /x4U6xrCZgwBIipLuvjr4cQTTiT+bS0wfr8jyBx5HnMf5nLL3suzvOlamJe80NKju/pP JK/g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QKtxvvsviVbui3Gkn8yABvSQlTGmZ18iycsNU5LP5c8=; b=exrC0XOUu/Xd5u+5sm/jphJ4asOrh4lXWttXmF8yBS19cdJoi2srWXt4lOYmtg8RiR tKIAQ9PyeA1nFLbURpddNyr1fP5aNLnZ7oV3+4+4vU7R0xC87g3Z3cOUd9q0M41gF50b rfIlCuqKTXx4ecAlP8pgoPBeDq8skEZdkZ230GeUSApJm7XNIN3g+A+ZRxtHAvmOUlWc KtZQONVBgKc/krHmTWFeu3WmW5X1kXuOgklnF9EoDG3KoO8Z6l47Hw3dooNQV35tAKam QM5hXfRe2wQAJSTdMlImj1Vesy49tYIxGdHK6NkytNDGwFihPsOOHDs0WMskw3C6ZkmK gVDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J+JRIOs3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j186si323768pfb.174.2019.01.28.09.17.56; Mon, 28 Jan 2019 09:18:11 -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=J+JRIOs3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732065AbfA1RR2 (ORCPT + 99 others); Mon, 28 Jan 2019 12:17:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:52728 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731887AbfA1QFi (ORCPT ); Mon, 28 Jan 2019 11:05:38 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 330392147A; Mon, 28 Jan 2019 16:05:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691537; bh=DFqmGOJ3LBP+z8Wjz8u/2EGfM5QptJOFDIpszZXQ/0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J+JRIOs3kvEnPnTgMkBSK2Eg/9Nziz41j9rwlWxjHfP2Vahvw10zQJ7OiYXCzxoTs p5xBAYHAiExbQatAD7Wu/fLWgvgLe8JEYIP12DJreHP8i5cdD6blkTnLMsSpVNAvg6 WKyZ1DTbJrp+wtvQKWHP5+d//hzQThtFImHR4kFQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yangtao Li , "Rafael J . Wysocki" , Sasha Levin , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 4.19 134/258] cpuidle: big.LITTLE: fix refcount leak Date: Mon, 28 Jan 2019 10:57:20 -0500 Message-Id: <20190128155924.51521-134-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yangtao Li [ 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