mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-29 03:36:07 +08:00
board_hw_rev_ver.c: check for 'rv == OK' before reading the revision
Otherwise a potential failure reading the hw version can get overwritten.
This commit is contained in:
@@ -468,7 +468,7 @@ int board_determine_hw_info()
|
||||
path = NULL;
|
||||
rvmft = px4_mtd_query("MTD_MFT_REV", NULL, &path);
|
||||
|
||||
if (rvmft == OK && path != NULL && hw_revision == HW_ID_EEPROM) {
|
||||
if (rv == OK && rvmft == OK && path != NULL && hw_revision == HW_ID_EEPROM) {
|
||||
|
||||
mtd_mft_v0_t mtd_mft = {MTD_MFT_v0};
|
||||
rv = board_get_eeprom_hw_info(path, (mtd_mft_t *)&mtd_mft);
|
||||
|
||||
Reference in New Issue
Block a user