mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-17 22:49:02 +00:00
board: phytec: phytec_som_detection: fix uninitialized bug
When som_type does not match any case, it is uninitialized and the function still tries to print the SoM info. Rather, this is an error condition and the function should abort prematurely. Highlight this by printing an error message and returning early. Signed-off-by: Yannic Moog <y.moog@phytec.de>
This commit is contained in:
parent
aa7858fe5e
commit
e2449ee968
1 changed files with 2 additions and 1 deletions
|
@ -161,7 +161,8 @@ void __maybe_unused phytec_print_som_info(struct phytec_eeprom_data *data)
|
|||
sub_som_type2 = 2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
pr_err("%s: Invalid SoM type: %i", __func__, api2->som_type);
|
||||
return;
|
||||
};
|
||||
|
||||
printf("SoM: %s-%03u-%s-%03u ",
|
||||
|
|
Loading…
Add table
Reference in a new issue