mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-16 12:20:05 +00:00
Check the firmware is valid for the device before applying
This commit is contained in:
parent
3c99ba4d3c
commit
003e4bf9b7
@ -217,6 +217,19 @@ fu_provider_chug_update (FuProvider *provider,
|
|||||||
if (item->fw_bin == NULL)
|
if (item->fw_bin == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
/* check this firmware is actually for this device */
|
||||||
|
if (!ch_device_check_firmware (item->usb_device,
|
||||||
|
g_bytes_get_data (item->fw_bin, NULL),
|
||||||
|
g_bytes_get_size (item->fw_bin),
|
||||||
|
&error_local)) {
|
||||||
|
g_set_error (error,
|
||||||
|
FU_ERROR,
|
||||||
|
FU_ERROR_NOT_POSSIBLE,
|
||||||
|
"firmware is not suitable: %s",
|
||||||
|
error_local->message);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* switch to bootloader mode */
|
/* switch to bootloader mode */
|
||||||
if (!item->is_bootloader) {
|
if (!item->is_bootloader) {
|
||||||
g_debug ("ColorHug: Switching to bootloader mode");
|
g_debug ("ColorHug: Switching to bootloader mode");
|
||||||
|
Loading…
Reference in New Issue
Block a user