From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: To: David Gibson Subject: Re: libfdt: Fix bugs in fdt_get_path() In-reply-to: <20080829041913.GC30197@yookeroo.seuss> References: <20080829041913.GC30197@yookeroo.seuss> Date: Thu, 25 Sep 2008 10:01:27 -0500 From: Jon Loeliger Message-Id: Cc: linuxppc-dev@ozlabs.org, devicetree-discuss@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , > The current implementation of fdt_get_path() has a couple of bugs, > fixed by this patch. > > First, contrary to its documentation, on success it returns the length > of the node's path, rather than 0. The testcase is correspondingly > wrong, and the patch fixes this as well. > > Second, in some circumstances, it will return -FDT_ERR_BADOFFSET > instead of -FDT_ERR_NOSPACE when given insufficient buffer space. > Specifically this happens when there is insufficient space even to > hold the path's second last component. This behaviour is corrected, > and the testcase updated to check it. > > Signed-off-by: David Gibson Applied. Thanks, jdl