]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
nand: Don't dereference NULL manufacturer_desc
authorSean Anderson <seanga2@gmail.com>
Sat, 4 Nov 2023 20:37:40 +0000 (16:37 -0400)
committerTom Rini <trini@konsulko.com>
Thu, 16 Nov 2023 17:43:48 +0000 (12:43 -0500)
When no manufacturer is matched, manufacturer_desc is NULL. Avoid
dereferencing it in that case.

Fixes: 4e67c571252 ("mtd,ubi,ubifs: sync with linux v3.15")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
drivers/mtd/nand/raw/nand_base.c

index 6b4adcf6bdc92016236a14e39ea47d474eb606df..44b6cb63a01fdc61736d8d717bb5f5ab1cacf5ad 100644 (file)
@@ -4462,17 +4462,14 @@ ident_done:
        else if (chip->jedec_version)
                pr_info("%s %s\n", manufacturer_desc->name,
                        chip->jedec_params.model);
-       else
+       else if (manufacturer_desc)
                pr_info("%s %s\n", manufacturer_desc->name, type->name);
 #else
        if (chip->jedec_version)
                pr_info("%s %s\n", manufacturer_desc->name,
                        chip->jedec_params.model);
-       else
+       else if (manufacturer_desc)
                pr_info("%s %s\n", manufacturer_desc->name, type->name);
-
-       pr_info("%s %s\n", manufacturer_desc->name,
-               type->name);
 #endif
 
        pr_info("%d MiB, %s, erase size: %d KiB, page size: %d, OOB size: %d\n",