From patchwork Wed Jul 23 23:44:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 34184 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DE2D220672 for ; Wed, 23 Jul 2014 23:45:57 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id y10sf12328321pdj.4 for ; Wed, 23 Jul 2014 16:45:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=lWrbqzRMrXcp5r5T+WC3tTu4G1ou7xHoSOnZioAUWNQ=; b=P/ingEz1BuWvdafBUCEZaY1KSesqQpN9DusEpZg1VjrOLgEhH7PkEW7HhoG4UMH0sa Hsn60JXARFAy1Suu1g+KYeZgk/SimFgYZIqqiWAXDDWCdNIZHHZ6ejkHRVcA9lTbx4M1 LnBkPUik185YWK+UQvY1KWkXHFRNUb/PSiwMoCYvvu6jnkI5Niqum3F01QkLCnUfLfBv R27Kwy52MfHbfUe8YtTWslXUIgDQL0uP5m78sVtOP+zL2zNF/VEhKrjvR1XtsfYGnKPl rBRuOBaSHOfGZXP4a93/nHi1eHZKOkTyzI76KEg1tUMhZb5rgnRKj0jHfBEqNGWK4mmQ 98yg== X-Gm-Message-State: ALoCoQk0rGjaqPGGUxGp/9ow88M1b1x1gdS4HCK0IrJCWqD+cTOVg02rTyQM5jt2Fbc6mzOBYWg2 X-Received: by 10.68.222.194 with SMTP id qo2mr2413822pbc.6.1406159157193; Wed, 23 Jul 2014 16:45:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.81 with SMTP id w75ls610824qgw.35.gmail; Wed, 23 Jul 2014 16:45:57 -0700 (PDT) X-Received: by 10.220.137.145 with SMTP id w17mr6835148vct.47.1406159157044; Wed, 23 Jul 2014 16:45:57 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id ol3si3799258veb.60.2014.07.23.16.45.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jul 2014 16:45:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id la4so3533905vcb.5 for ; Wed, 23 Jul 2014 16:45:56 -0700 (PDT) X-Received: by 10.52.129.200 with SMTP id ny8mr5822625vdb.27.1406159156947; Wed, 23 Jul 2014 16:45:56 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp320996vcb; Wed, 23 Jul 2014 16:45:56 -0700 (PDT) X-Received: by 10.68.139.74 with SMTP id qw10mr6033348pbb.100.1406159156017; Wed, 23 Jul 2014 16:45:56 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dv3si2032058pdb.238.2014.07.23.16.45.55 for ; Wed, 23 Jul 2014 16:45:56 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758657AbaGWXpy (ORCPT + 16 others); Wed, 23 Jul 2014 19:45:54 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:57432 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758607AbaGWXol (ORCPT ); Wed, 23 Jul 2014 19:44:41 -0400 Received: by mail-pd0-f178.google.com with SMTP id w10so2524094pde.9 for ; Wed, 23 Jul 2014 16:44:41 -0700 (PDT) X-Received: by 10.66.227.225 with SMTP id sd1mr6011742pac.106.1406159080999; Wed, 23 Jul 2014 16:44:40 -0700 (PDT) Received: from trevor.secretlab.ca (S0106602ad082623c.cg.shawcable.net. [68.146.69.61]) by mx.google.com with ESMTPSA id yo9sm13763749pac.25.2014.07.23.16.44.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jul 2014 16:44:40 -0700 (PDT) Received: by trevor.secretlab.ca (Postfix, from userid 1000) id DD4C8C43A0F; Wed, 23 Jul 2014 17:44:26 -0600 (MDT) From: Grant Likely To: linux-kernel@vger.kernel.org, Nathan Fontenot , Tyrel Datwyler , Pantelis Antoniou , devicetree@vger.kernel.org Cc: Grant Likely Subject: [PATCH 07/10] of: Make sure attached nodes don't carry along extra children Date: Wed, 23 Jul 2014 17:44:21 -0600 Message-Id: <1406159064-21366-8-git-send-email-grant.likely@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1406159064-21366-1-git-send-email-grant.likely@linaro.org> References: <1406159064-21366-1-git-send-email-grant.likely@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: grant.likely@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The child pointer does not get cleared when attaching new nodes which could cause the tree to be inconsistent. Clear the child pointer in __of_attach_node() to be absolutely sure that the structure remains in a consistent layout. Signed-off-by: Grant Likely --- drivers/of/dynamic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index c875787fa394..b96d83100987 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -98,6 +98,7 @@ int of_property_notify(int action, struct device_node *np, void __of_attach_node(struct device_node *np) { + np->child = NULL; np->sibling = np->parent->child; np->allnext = np->parent->allnext; np->parent->allnext = np;