From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Kerr Subject: Re: [PATCH 2/3] of/flattree: Fix crash when device tree absent Date: Thu, 15 Jul 2010 09:11:02 +0800 Message-ID: <1279156262.15089.68.camel@pororo.lan> References: <20100714233130.21887.73872.stgit@angua> <20100714233136.21887.27766.stgit@angua> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20100714233136.21887.27766.stgit@angua> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: Grant Likely Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org List-Id: devicetree@vger.kernel.org Hi Grant, > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c > index d61fda8..66401bc 100644 > --- a/drivers/of/fdt.c > +++ b/drivers/of/fdt.c > @@ -94,6 +94,8 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node, > break; > } while (1); > > + if (rc) > + pr_err("Failed to unflatten device tree blob. rc=%i\n", rc); > return rc; > } rc == 1 is perfectly valid - it indicates that the iterator callback stopped the scan early. How about we just check for the presence of OF_DT_HEADER instead? Cheers, Jeremy