mach-snapdragon: add a check before copying FDT to fdt_addr_r
authorSughosh Ganu <sughosh.ganu@linaro.org>
Tue, 17 Jun 2025 10:43:45 +0000 (16:13 +0530)
committerTom Rini <trini@konsulko.com>
Wed, 25 Jun 2025 15:50:37 +0000 (09:50 -0600)
commit4641419f41b347a38a07f19c809b7aab63864dd1
treef81b01ce12d4e88dda98603b08e685f3aa0732c0
parent7aa19c3667d1cd23417f4ec7f5cb5dab260cfbf3
mach-snapdragon: add a check before copying FDT to fdt_addr_r

The board_late_init() function allocates memory for a bunch of
environment variables, including fdt_addr_r. The device-tree then gets
copied to the memory pointed to by fdt_addr_r. However, the memory
allocation request can fail, in which case the address that is being
written to would not be allocated. Add a check that the memory
allocation has succeeded before copying the device-tree.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
arch/arm/mach-snapdragon/board.c