From 23fe0c0747a376e39ce54485735a5df3b322f90b Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sat, 4 Nov 2023 16:37:39 -0400 Subject: [PATCH] spl: nand: Fix NULL-pointer dereference spl_nand_fit_read unconditionally accesses load->priv. Ensure it is set. Fixes: 00e180cc513 ("spl: nand: support loading i.MX container format file") Signed-off-by: Sean Anderson --- common/spl/spl_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c index 07916bedbb..5b6932bf7e 100644 --- a/common/spl/spl_nand.c +++ b/common/spl/spl_nand.c @@ -105,7 +105,7 @@ static int spl_nand_load_element(struct spl_image_info *spl_image, struct spl_load_info load; load.dev = NULL; - load.priv = NULL; + load.priv = &offset; load.filename = NULL; load.bl_len = bl_len; load.read = spl_nand_fit_read; -- 2.39.5