Skip to content

Commit bb72f44

Browse files
ausyskinTomas Winkler
authored andcommitted
igsc: cli: fix fw data update check
Compare firmware data field-by-field as some fields present only in device version, but not in image one. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
1 parent a508d0d commit bb72f44

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/igsc_cli.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2892,8 +2892,17 @@ int fwdata_update(const char *image_path, struct igsc_device_handle *handle,
28922892
}
28932893
print_dev_fwdata_version(&dev_version);
28942894

2895-
/* check the new version */
2896-
if (memcmp(&img_version, &dev_version, sizeof(struct igsc_fwdata_version)))
2895+
/* check the new version
2896+
* If there is IGSC_FWDATA_FITB_VALID_MASK bit set in flags the update is failed.
2897+
* Image always have zero there.
2898+
* No need to compare FITB fields.
2899+
*/
2900+
if (img_version.format_version != dev_version.format_version ||
2901+
img_version.oem_manuf_data_version != dev_version.oem_manuf_data_version ||
2902+
img_version.major_version != dev_version.major_version ||
2903+
img_version.major_vcn != dev_version.major_vcn ||
2904+
img_version.flags != dev_version.flags ||
2905+
img_version.data_arb_svn != dev_version.data_arb_svn)
28972906
{
28982907
fwupd_error("After the update fwdata version wasn't updated on the device\n");
28992908
ret = EXIT_FAILURE;

0 commit comments

Comments
 (0)