From patchwork Tue Feb 2 13:37:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 374630 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp215812jah; Tue, 2 Feb 2021 05:52:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTNnTN0NnONP7L1uciaC+0F39sFeF6CH1fdw/buTRvvfO1ew4OHeoG4Pl2Weuym3W2+ZaD X-Received: by 2002:a17:906:3484:: with SMTP id g4mr1739754ejb.38.1612273959498; Tue, 02 Feb 2021 05:52:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612273959; cv=none; d=google.com; s=arc-20160816; b=dTG9muQPA+haGLuYwTePvKwOb0gpe4R5ZlLnyU7GpI5pKPbJQVgN5Lsu7ui3fsbWEX 7ZtzXWjOg7GMlPopJQI1l1cAYvsmTPtqPbI+xgRkzV3wPV450wdU14oep5ZnJN+4GVan Tol01IqS7Tf9Czlb8MAcYOkvR6BNaIStezF44WQ+WmPRUXG1QB3BbqLLBkMAviK6aO8E IjIe0fhOlNEjB1kEafnfDOMVcixt1jL3DORiaQALSyOcZa/tfBkeHAUncROOYl/XUaAF k7+ShWduQfitZYNjnUJK6yCK5v5FmoqUbzEpPUsE/CEcV3ZFKuIISBN3uMqkK+Ffaque LMYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QZbXJgFmgCD/re5DYrzZ7YfkR66SXWWIVFUi5fEXhKg=; b=0Ddu1mNIFZI1IDRf4Lnzm5SkqKsBILMIxzhXxNlPQaAp9T9aUmEatvmywcvfvBYeTh fnn5TNK7M3tDSZJzjvWRFJ/NM4odrMlLp4Of5D0SMganRVNVGw5h4aC691SN4HiPbPTS ImOw0clmTvTK7RU8kZ091vOnWJffNafOTpXTeCedPLbcqVKBsauPDeHUr3Ej7WdKAGCX WWcxVCj+gQjs1g2zUsStEDdqNQnvP0zB362B4ZG2ktt4H1rAt/RucKXAxR5uHrG8I9Fi TBSLXherKwkvyTXqy/pR9sBs8k7eFG4zuEWyxjoh+EiztMa7KMUArPE+20+dk0HY/un+ OVtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=np55G4kG; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jy25si2131828ejc.530.2021.02.02.05.52.39; Tue, 02 Feb 2021 05:52:39 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=np55G4kG; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231855AbhBBNvf (ORCPT + 13 others); Tue, 2 Feb 2021 08:51:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:38206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232935AbhBBNt5 (ORCPT ); Tue, 2 Feb 2021 08:49:57 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BA1BE64FA9; Tue, 2 Feb 2021 13:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273370; bh=y8JFE/VqcFyPjMVmP3r4ItbHDZdqffmmVNcvOGAVUtw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=np55G4kGtCVJCKZzSSMRHo4JqxG3HRVtPoID7LdtRxsaCnwNr8ohQ7a6mMfKkCVfJ OLDSUKhhMYD/qijTmGqdztrSfWFELI57nRo9YC0ERyIEkfDccrilrKtZOWJgwg9rl9 JtGnqAwX+u491Y8ttYX2JbmpnVYaj0gCjpY5uCoQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Packham , Qi Zheng , Russell King , Rob Herring Subject: [PATCH 5.10 074/142] ARM: zImage: atags_to_fdt: Fix node names on added root nodes Date: Tue, 2 Feb 2021 14:37:17 +0100 Message-Id: <20210202133000.769884813@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132957.692094111@linuxfoundation.org> References: <20210202132957.692094111@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Rob Herring commit 30596ae0547dbda469d31a2678d9072fb0a3fa27 upstream. Commit 7536c7e03e74 ("of/fdt: Remove redundant kbasename function call") exposed a bug creating DT nodes in the ATAGS to DT fixup code. Non-existent nodes would mistaken get created with a leading '/'. The problem was fdt_path_offset() takes a full path while creating a node with fdt_add_subnode() takes just the basename. Since this we only add root child nodes, we can just skip over the '/'. Fixes: 7536c7e03e74 ("of/fdt: Remove redundant kbasename function call") Reported-by: Chris Packham Cc: Qi Zheng Cc: Russell King Signed-off-by: Rob Herring Tested-by: Chris Packham Link: https://lore.kernel.org/r/20210126023905.1631161-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman --- arch/arm/boot/compressed/atags_to_fdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/arch/arm/boot/compressed/atags_to_fdt.c +++ b/arch/arm/boot/compressed/atags_to_fdt.c @@ -15,7 +15,8 @@ static int node_offset(void *fdt, const { int offset = fdt_path_offset(fdt, node_path); if (offset == -FDT_ERR_NOTFOUND) - offset = fdt_add_subnode(fdt, 0, node_path); + /* Add the node to root if not found, dropping the leading '/' */ + offset = fdt_add_subnode(fdt, 0, node_path + 1); return offset; }