]> git.baikalelectronics.ru Git - uboot.git/commitdiff
caam: Fix crash in case caam_jr_probe failed
authorYe Li <ye.li@nxp.com>
Wed, 11 May 2022 08:26:20 +0000 (13:56 +0530)
committerStefano Babic <sbabic@denx.de>
Fri, 20 May 2022 10:36:47 +0000 (12:36 +0200)
If probing caam_jr returns failure, the variable "dev" will not be
initialized, so we can't use dev->name for the error print.
Otherwise it will cause crash.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
arch/arm/cpu/armv7/ls102xa/cpu.c
arch/arm/cpu/armv8/fsl-layerscape/cpu.c
arch/arm/mach-imx/imx8/cpu.c
arch/arm/mach-imx/imx8m/soc.c
arch/arm/mach-imx/mx6/soc.c
arch/arm/mach-imx/mx7/soc.c
arch/arm/mach-imx/mx7ulp/soc.c
arch/powerpc/cpu/mpc85xx/cpu_init.c
board/freescale/imx8mm_evk/spl.c
board/freescale/imx8mn_evk/spl.c
board/freescale/imx8mp_evk/spl.c

index 9fe1cd904876383c5afe04578612645fdfefd3d2..0b3e3b206411dfa0e1cb6d7fba99c55a8cd66cc8 100644 (file)
@@ -409,7 +409,7 @@ int arch_misc_init(void)
 
                ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
                if (ret)
-                       printf("Failed to initialize %s: %d\n", dev->name, ret);
+                       printf("Failed to initialize caam_jr: %d\n", ret);
        }
 
        return 0;
index a71ee636afe6e5f7e79ff339f76eb47548a27f8d..253008a9c1334c47be51bc014905d40361077cd2 100644 (file)
@@ -1648,7 +1648,7 @@ int arch_misc_init(void)
 
                ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
                if (ret)
-                       printf("Failed to initialize %s: %d\n", dev->name, ret);
+                       printf("Failed to initialize caam_jr: %d\n", ret);
        }
        serdes_misc_init();
 
index 0858ea5f0575c76da8a627b60ea4934a3abb10d9..936c8f865aaf07bb2da267eb39e02559d2390647 100644 (file)
@@ -100,7 +100,7 @@ int arch_misc_init(void)
 
                ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
                if (ret)
-                       printf("Failed to initialize %s: %d\n", dev->name, ret);
+                       printf("Failed to initialize caam_jr: %d\n", ret);
        }
 
        return 0;
index d261a07241d44663f0725cfbab04e77763ecbaac..59335356b579ccec485638e542591417798c554d 100644 (file)
@@ -1408,7 +1408,7 @@ int arch_misc_init(void)
 
                ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
                if (ret)
-                       printf("Failed to initialize %s: %d\n", dev->name, ret);
+                       printf("Failed to initialize caam_jr: %d\n", ret);
        }
 
        return 0;
index 2434bcfa9877acbffa75317d2bafecbde939901a..67bd9919892e5ecd6bd50759cf7a98e9d5ca5b7f 100644 (file)
@@ -744,7 +744,7 @@ int arch_misc_init(void)
 
                ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
                if (ret)
-                       printf("Failed to initialize %s: %d\n", dev->name, ret);
+                       printf("Failed to initialize caam_jr: %d\n", ret);
        }
        setup_serial_number();
        return 0;
index dc9ac31eb0f9970402f3f4bfa677a187bb3eea4a..c672be5d5dd4beac79479d0938939e67eeb3f87b 100644 (file)
@@ -361,7 +361,7 @@ int arch_misc_init(void)
                int ret;
                ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
                if (ret)
-                       printf("Failed to initialize %s: %d\n", dev->name, ret);
+                       printf("Failed to initialize caam_jr: %d\n", ret);
        }
 
        return 0;
index 08bdc0c4af597eea6c0477b059f25d6552053c61..217b7c45867d35cf48d1b0dbc3cbd931f554a8cc 100644 (file)
@@ -93,7 +93,7 @@ int arch_misc_init(void)
 
                ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
                if (ret)
-                       printf("Failed to initialize %s: %d\n", dev->name, ret);
+                       printf("Failed to initialize caam_jr: %d\n", ret);
        }
 
        return 0;
index 16981de244b41127305e35a38ca653241cb3ad70..5fa4234fd090f014b3bb5a41a5846c607ab6a84f 100644 (file)
@@ -950,7 +950,7 @@ int arch_misc_init(void)
 
                ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
                if (ret)
-                       printf("Failed to initialize %s: %d\n", dev->name, ret);
+                       printf("Failed to initialize caam_jr: %d\n", ret);
        }
 
        return 0;
index ae2fb73fc5128b733f58053ab93b92fb770369c0..4d963246856f9b9e641eea1ad8489cca3d242a10 100644 (file)
@@ -57,7 +57,7 @@ void spl_board_init(void)
 
                ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
                if (ret)
-                       printf("Failed to initialize %s: %d\n", dev->name, ret);
+                       printf("Failed to initialize caam_jr: %d\n", ret);
        }
        puts("Normal Boot\n");
 }
index 3d9aa56d2c0619ddbb6e9423f73a8abe2efd204c..14cb51368f8bbef6b6b9c8ca42d1ebcc68ccd009 100644 (file)
@@ -52,7 +52,7 @@ void spl_board_init(void)
        if (IS_ENABLED(CONFIG_FSL_CAAM)) {
                ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
                if (ret)
-                       printf("Failed to initialize %s: %d\n", dev->name, ret);
+                       printf("Failed to initialize caam_jr: %d\n", ret);
        }
        puts("Normal Boot\n");
 
index a2732148f24090806e0aee66c2a47e45b8930871..719b1f6d7da589c4e75c96809d663a12b2631bc1 100644 (file)
@@ -43,7 +43,7 @@ void spl_board_init(void)
 
                ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev);
                if (ret)
-                       printf("Failed to initialize %s: %d\n", dev->name, ret);
+                       printf("Failed to initialize caam_jr: %d\n", ret);
        }
        /*
         * Set GIC clock to 500Mhz for OD VDD_SOC. Kernel driver does