spl: NULL check variable before dereference
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Fri, 18 Jul 2025 12:19:54 +0000 (13:19 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 29 Jul 2025 19:12:12 +0000 (13:12 -0600)
commitae409a84e7bffb0c5a0d420d72806ac7b854f619
treef9b12fe5fd4adf3e806327ce652d6eeaf8f81c9b
parent808d4bc2bdcedb9ffca57b85984e53d39e1cb718
spl: NULL check variable before dereference

In boot_from_devices the variable loader is not NULL checked after
assignment and before first use but later code does check it for NULL.
Add a NULL check before first use.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
common/spl/spl.c