From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko =?ISO-8859-1?Q?St=FCbner?= Date: Fri, 08 Nov 2019 15:50:48 +0100 Subject: [U-Boot] [PATCH v3 1/4] fdtdec: protect against another NULL phandlep in fdtdec_add_reserved_memory() In-Reply-To: <20191023144641.5710-1-heiko@sntech.de> References: <20191023144641.5710-1-heiko@sntech.de> Message-ID: <4798247.DyQcYcuMpC@diego> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am Mittwoch, 23. Oktober 2019, 16:46:38 CET schrieb Heiko Stuebner: > From: Heiko Stuebner > > The change adding fdtdec_add_reserved_memory() already protected the added > phandle against the phandlep being NULL - making the phandlep var optional. > > But in the early code checking for an already existing carveout this check > was not done and thus the phandle assignment could run into trouble, > so add a check there as well, which makes the function still return > successfully if a matching region is found, even though no-one wants to > work with the phandle. > > Fixes: c9222a08b3f7 ("fdtdec: Implement fdtdec_add_reserved_memory()") > Signed-off-by: Heiko Stuebner this patch already received in v2 a Reviewed-by: Simon Glass