]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spl: nand: Fix NULL-pointer dereference
authorSean Anderson <seanga2@gmail.com>
Sat, 4 Nov 2023 20:37:39 +0000 (16:37 -0400)
committerTom Rini <trini@konsulko.com>
Thu, 16 Nov 2023 17:43:48 +0000 (12:43 -0500)
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 <seanga2@gmail.com>
common/spl/spl_nand.c

index 07916bedbb91c607b780c4245a5268f970c50f51..5b6932bf7e07caf8ebe58495edb3627273e8e79d 100644 (file)
@@ -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;