Skip to content

Commit

Permalink
igsc: cli: fix return value treatment of match device function
Browse files Browse the repository at this point in the history
Fix return value treatment of match device function

Signed-off-by: Vitaly Lubart <[email protected]>
  • Loading branch information
vlubart authored and Tomas Winkler committed Jul 24, 2022
1 parent c1fd588 commit 20129a9
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions src/igsc_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -2416,32 +2416,17 @@ int fwdata_update(const char *image_path, struct igsc_device_handle *handle,
print_dev_fwdata_version(&dev_version);

ret = igsc_image_fwdata_match_device(oimg, dev_info);
if (ret == IGSC_SUCCESS)
{
update = true;
}
else if (ret == IGSC_ERROR_NOT_SUPPORTED)
{
update = allow_downgrade;
}
else if (ret == IGSC_ERROR_DEVICE_NOT_FOUND)
if (ret == IGSC_ERROR_DEVICE_NOT_FOUND)
{
fwupd_error("The image is not compatible with the device\nDevice info doesn't match image device Id extension\n");
goto exit;
}
else
else if (ret != IGSC_SUCCESS)
{
fwupd_error("Internal error\n");
goto exit;
}

if (!update)
{
fwupd_msg("In order to update run with -a | --allow-downgrade\n");
ret = EXIT_FAILURE;
goto exit;
}

cmp = igsc_fwdata_version_compare(&img_version, &dev_version);
switch (cmp)
{
Expand Down

0 comments on commit 20129a9

Please sign in to comment.