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:
Ye Li
2022-05-11 13:56:20 +05:30
committed by Stefano Babic
parent 5ed4c33f36
commit cda8f87349
11 changed files with 11 additions and 11 deletions

View 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;

View 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();

View 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;

View 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;

View 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;

View 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;

View 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;

View 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;