broadband-modem-qmi: avoid NULL success return in firmware_load_list
Instead of assuming that NULL is a valid return, make sure we return an error instead.
This commit is contained in:
@@ -99,10 +99,15 @@ load_list_ready (MMIfaceModemFirmware *self,
|
||||
GError *error = NULL;
|
||||
|
||||
ctx->list = MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_list_finish (self, res, &error);
|
||||
if (error) {
|
||||
g_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||
handle_list_context_free (ctx);
|
||||
return;
|
||||
if (!ctx->list) {
|
||||
/* Not found isn't fatal */
|
||||
if (!g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND)) {
|
||||
g_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||
handle_list_context_free (ctx);
|
||||
return;
|
||||
}
|
||||
mm_dbg ("Couldn't load firmware image list: %s", error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
MM_IFACE_MODEM_FIRMWARE_GET_INTERFACE (self)->load_current (MM_IFACE_MODEM_FIRMWARE (self),
|
||||
|
Reference in New Issue
Block a user