mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-24 15:21:43 +02:00
caam: Fix crash in case caam_jr_probe failed
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>
This commit is contained in:
parent
5ed4c33f36
commit
cda8f87349
@ -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;
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user