From patchwork Wed May 19 12:32:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 52978 X-Patchwork-Delegate: grant.likely@secretlab.ca Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 69878B7FA8 for ; Wed, 19 May 2010 22:32:36 +1000 (EST) Received: by ozlabs.org (Postfix) id 5FD83B7D1F; Wed, 19 May 2010 22:32:29 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: by ozlabs.org (Postfix, from userid 1034) id 5D9D4B7D4E; Wed, 19 May 2010 22:32:29 +1000 (EST) To: Message-Id: <0958c243b32f5f77028a794a9ce0d55f9a12121e.1274272289.git.michael@ellerman.id.au> From: Michael Ellerman Subject: [PATCH] device-tree: Drop properties with "/" in their name Date: Wed, 19 May 2010 22:32:29 +1000 (EST) Cc: linuxppc-dev@ozlabs.org, monstr@monstr.eu, microblaze-uclinux@itee.uq.edu.au X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Some bogus firmwares include properties with "/" in their name. This causes problems when creating the /proc/device-tree file system, because the slash is taken to indicate a directory. We don't care about those properties, and we don't want to encourage them, so just throw them away when creating /proc/device-tree. Signed-off-by: Michael Ellerman Tested-by: Christian Kujau --- Hi Christian, if you could test this new patch that'd be great, thanks! fs/proc/proc_devtree.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c index ce94801..d9396a4 100644 --- a/fs/proc/proc_devtree.c +++ b/fs/proc/proc_devtree.c @@ -209,6 +209,9 @@ void proc_device_tree_add_node(struct device_node *np, for (pp = np->properties; pp != NULL; pp = pp->next) { p = pp->name; + if (strchr(p, '/')) + continue; + if (duplicate_name(de, p)) p = fixup_name(np, de, p);