From 92db5fc87ae464bde5a0d7604f11e1a7f26915ae Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Mon, 5 Sep 2022 09:38:11 +0100 Subject: [PATCH] modem-manager: Fix a critical warning when issuing Secure Boot AT commands Fixes https://github.com/fwupd/fwupd/issues/4998 --- plugins/modem-manager/fu-mm-device.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/modem-manager/fu-mm-device.c b/plugins/modem-manager/fu-mm-device.c index f1a4f6c92..99909e09e 100644 --- a/plugins/modem-manager/fu-mm-device.c +++ b/plugins/modem-manager/fu-mm-device.c @@ -1822,14 +1822,16 @@ fu_mm_device_setup_secboot_status_quectel(FuMmDevice *self) return; } - /* Try to query sec boot status with AT commands */ + /* try to query sec boot status with AT commands */ for (guint i = 0; at_cmd[i] != NULL; i++) { - if (!fu_mm_device_at_cmd(self, at_cmd[i], TRUE, &error_local)) + g_autoptr(GError) error_loop = NULL; + if (!fu_mm_device_at_cmd(self, at_cmd[i], TRUE, &error_loop)) { g_debug("AT command failed (%s): %s", at_cmd[i], - error_local->message); - else + error_loop->message); + } else { return; + } } }