Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3428000imu; Sun, 11 Nov 2018 14:52:45 -0800 (PST) X-Google-Smtp-Source: AJdET5ebWOll1/gQwULkUky8M5EIxoCTkcFH+z6vhvQx0xftqRKyYDQDMr/qH/Fgf5N8Y4KcyQy9 X-Received: by 2002:a17:902:2cc1:: with SMTP id n59-v6mr10603976plb.26.1541976765354; Sun, 11 Nov 2018 14:52:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541976765; cv=none; d=google.com; s=arc-20160816; b=EemoeomThlt//POme01JUaPW9/LojM1qqio+8LIDpMmYa7EBuZfKoWKR98pWYzTDLU k+52gscd3E5pS3kcyCpDN/PUyQwvMgI8uAgllUCZRumO7gqVI4qkp+TumJmF8u+msxf+ lhf/Iym0o0VPpEBU2YQMXY3BhAJQxN+sfAYVSPSWqTkORIIxSpU4OiKO6xL+7d81o2mX XnTswxIiEO3lDoGPG+GBPgUdL9xtFiuqfdbbgMOmWwoszi38J7ZkA4bB7ghudz42485a Ki8kZRURmDo2lUP7D7Pg+b0GUTmQg5jDzfDgrEDPHerrYuWNkG98ghWYEp6PWF6aWUhf wwbg== 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=bwzztqJEvnzLRWbqQFu+5ohmAMxKN17J/INWINt1i+w=; b=Be3cY56cFXxyGTkxNlX4dlX8ip6WpCLYfLlyNkjy8SLcBKuNVircBUHNwXqKkfAJ3Y DUmi8gqmREwLygcLmO4IAojNpvvGjX+Q38NN7a5edIlnn2sQIWU3xovFP8MZHlSzIYcU aNsZ7tYU3TMxIs3rJuFBVeJWo7zBh7GlYlkikCIiC6aUfhJpsaCGUdjs499i3H9P/P5c Bly4ASaeGnaS6m5QIsgTybk4uQ7qG3JrnR2KUOljkfmvwqW45wvRXvnZjnH/V1bMVIjg 8lvS53CPadoQrljdr/PGtlny0/8hZgOl5EJWf3iSE5Ri3oMeTSlnOGOaOZ8nGcRIa1Np 3obQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="je6/gvZl"; 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 o13-v6si17907401pfd.46.2018.11.11.14.52.30; Sun, 11 Nov 2018 14:52:45 -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="je6/gvZl"; 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 S2390890AbeKLImL (ORCPT + 99 others); Mon, 12 Nov 2018 03:42:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:54620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404103AbeKLIXE (ORCPT ); Mon, 12 Nov 2018 03:23:04 -0500 Received: from localhost (unknown [206.108.79.134]) (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 8AC6721582; Sun, 11 Nov 2018 22:33:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975587; bh=gxABbROjOMrnswN+D7TAmu/vwt4b33lJwJ/GOmmg1EA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=je6/gvZl4TIZSm5qcCKsGZZca52quLreneWZpIdLRJb63e5k3c5WakAKO5OT/Y//4 b84iwylzJs5DLT5jqpCuVsFmFSN9TrHOTX6/dd0jdpCxvCqxhkFvuOAiLlRs2TrwHN VjiAzlRhYBX6McV5ZWkezDLRywI79SoJuGqemgSM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mikko Perttunen , Johan Hovold , Thierry Reding Subject: [PATCH 4.14 194/222] soc/tegra: pmc: Fix child-node lookup Date: Sun, 11 Nov 2018 14:24:51 -0800 Message-Id: <20181111221704.192458638@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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. ------------------ From: Johan Hovold commit 1dc6bd5e39a29453bdcc17348dd2a89f1aa4004e upstream. Fix child-node lookup during probe, which ended up searching the whole device tree depth-first starting at the parent rather than just matching on its children. To make things worse, the parent pmc node could end up being prematurely freed as of_find_node_by_name() drops a reference to its first argument. Fixes: 3568df3d31d6 ("soc: tegra: Add thermal reset (thermtrip) support to PMC") Cc: stable # 4.0 Cc: Mikko Perttunen Signed-off-by: Johan Hovold Reviewed-by: Mikko Perttunen Signed-off-by: Thierry Reding Signed-off-by: Greg Kroah-Hartman --- drivers/soc/tegra/pmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -1321,7 +1321,7 @@ static void tegra_pmc_init_tsense_reset( if (!pmc->soc->has_tsense_reset) return; - np = of_find_node_by_name(pmc->dev->of_node, "i2c-thermtrip"); + np = of_get_child_by_name(pmc->dev->of_node, "i2c-thermtrip"); if (!np) { dev_warn(dev, "i2c-thermtrip node not found, %s.\n", disabled); return;