Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3467723imu; Sun, 11 Nov 2018 15:47:13 -0800 (PST) X-Google-Smtp-Source: AJdET5cIJ9d4DlSqeGKPldG/h+ZQebjAjV55TKBTZPVJabDgxNG8S7hHGv7vSB0gaJGa7/5eUjS4 X-Received: by 2002:a63:5026:: with SMTP id e38mr15568293pgb.123.1541980033221; Sun, 11 Nov 2018 15:47:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980033; cv=none; d=google.com; s=arc-20160816; b=A5RkLYMANrSvU6zBZVg1NVrZloHxiAyAyZZm3cVxzMET2cuQaNEjYz58qtsa643Fce 4qwylqmvkr56Oum3fzqy6e5MwGIIIGux1WMbO6ev9BGwvjN9o1PJd8RaitozTaDzH+wo bMg1nYdTGE5EH8WOSyWYX4wMbLOFPRvXvwRL9HRrG2czuQDv9oPYT3djLFolrMF9GE/6 VAFfkyNScNdJz/LY2xiUz3QQl3Ze0yMi/Mwp7TQUQoqfyTAeQivng9CwDkClOoXYOvJR D/zoLm/VzR5+voqExL6x6RuL+vE38qPqNaUMYjZXxWLV1hmjzAtbN1QO75NQqD3VglI7 KV0A== 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=3zBCmZGcM2nV0AnPZuyU6GN5tka4SeTUVyAGRFOSrJI=; b=NZpTZuHmAvBgnFbeA/XgtulMTCZV+AuZbHkPtVMmeLOPHy7SkcGoJ9CM5IkCPmujuN FlVra1p5XfmShkucVqQUdISiW4iiYCt11j+eg0FcZMLZtMwO6c5Og/GkjUu4OnkIG0ae xTbtT+YAY2xgQGu/JJ8VP0qUyAx66ic1xNy9ABUHrXK/Uss9EirGvfx4pmazXsEx5ONj mm28nF1Mp78P7mvCAAZJQBNt9OCweE0Mf8OiiSRNYfS0HXQJ0w7EwX8dydiyv1cNA+2U luQYP0Ns6pzMkhE2yRn4FKYy9BkTfIdITyJzGsem9wZ4DcUkxuvsRXtnoNwz/TvhjOdW /vhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KFsR5r56; 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 u35si12405432pga.226.2018.11.11.15.46.58; Sun, 11 Nov 2018 15:47:13 -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=KFsR5r56; 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 S1733230AbeKLISy (ORCPT + 99 others); Mon, 12 Nov 2018 03:18:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:39558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733220AbeKLISy (ORCPT ); Mon, 12 Nov 2018 03:18:54 -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 D7CAF21104; Sun, 11 Nov 2018 22:28:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975338; bh=4QLv5IeVXHy5Fws2LlfR699sq5gZgue+H9+jZaKj74Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KFsR5r56dvK/LI+bBBoSLN6kcgVcDpQ2blOa/vECsgorH9IhJfmAXvXXzYAzlru16 V5Ha/BzUS/6D0iWzgx408UQacIImyo5K+iuNByjZ/hKX6JtUl/ZCbR6ewv9P4LMioG LwaPKgtkM7DJKcG4OWfvg9oNOcvLUE8QcPbYKzv4= 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.19 322/361] soc/tegra: pmc: Fix child-node lookup Date: Sun, 11 Nov 2018 14:21:09 -0800 Message-Id: <20181111221659.168404056@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@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.19-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 @@ -1288,7 +1288,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;