Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp646727pxb; Tue, 2 Feb 2021 14:15:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9vKx9Pkv0ywfKYXMJBhr6juW1IvRm1SCHHSLVH62n16pRKHEpOEWp+CNUrdKGAlDESFP4 X-Received: by 2002:aa7:c719:: with SMTP id i25mr202017edq.197.1612304131040; Tue, 02 Feb 2021 14:15:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612304131; cv=none; d=google.com; s=arc-20160816; b=GSf0YcvfL250oa/L19KMVyx51oTOcDkPvJftu5KHM3OQMTWzpJzAj40hHAcyHOnIqs 5DBhPygeP902sJTgJJGTGcbfzQwqYBBAMFcmmTr/aF6AmTCU5MHkdrQCSapTN2li2JS/ aXWC5U6slig45eXnI9vXzg8zVXYILRNTQ3W9Y+88drWyQM6YhQiK3RosIR+i5djyuVGs EFNwbfLQzDsM87LGlqHDXKif63+qkHy2JQWxqNVdDOjAkaU5b09e52RVQuQU/OvBBT6X sYVn+aqIxvI1AOa7xlc/aNrnRuZZfrmv7FfVLUG2a+WeHNj31NrDb6d9wV9lSurts+pT 97/A== 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=sAlNbMe7YYG12ky5J+B9zJ1BdmD6icFngOlTeaF4ybvmRHybk92BFlRcUwDowyGQgH S84XSLvy3c9uxcZssnm4YXM7F0POlHMJEEgoU6FxIBXGhWEULMygWQkExc6Ysi9gkkcn tOAu2Hc2p4FbQALE4ncKbnfIhJ4h5epz8jExNTZlp5hwe8CPNWP7jaxs1PHb2oazKNam VsTjI9aT8VHfkN7crzMmEeCGRWaLhRVK5qo+a/vT0w0Jq1UG30uHa5ji/1qp7MZRDDk+ GxmHNkMMvxtSIN6N7dUo15B4oE0eKOLKUtp5PtYTlZFvk0yDzpfCewcJlti+fRpLfQZW mx/Q== 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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 g23si113459ejo.55.2021.02.02.14.15.05; Tue, 02 Feb 2021 14:15:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S233376AbhBBN4t (ORCPT + 99 others); Tue, 2 Feb 2021 08:56:49 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; }