mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
board: st: common: add uclass_get_device_by_driver()'s return value check
class_get_device_by_driver()'s return value is not checked, in case of BSEC driver is not probed, dev is not set and used just after as parameter of misc_read() which leads to a Synchronous Abort. Add uclass_get_device_by_driver()'s return value check to fix it. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
This commit is contained in:
parent
32912d0908
commit
6a6f2eb3e6
@ -92,6 +92,11 @@ static int do_stboard(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
DM_DRIVER_GET(stm32mp_bsec),
|
||||
&dev);
|
||||
|
||||
if (ret) {
|
||||
puts("Can't get BSEC device\n");
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
ret = misc_read(dev, STM32_BSEC_OTP(BSEC_OTP_BOARD),
|
||||
&otp, sizeof(otp));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user