diff options
-rw-r--r-- | src/qmi-device.c | 15 | ||||
-rw-r--r-- | src/qmi-message-ctl.c | 12 | ||||
-rw-r--r-- | src/qmi-message-dms.c | 4 |
3 files changed, 20 insertions, 11 deletions
diff --git a/src/qmi-device.c b/src/qmi-device.c index ae7ca41..8395942 100644 --- a/src/qmi-device.c +++ b/src/qmi-device.c @@ -786,17 +786,10 @@ process_message (QmiDevice *self, if (!tr) g_debug ("[%s] No transaction matched in received message", self->priv->path_display); - else { - /* Received message is a response in a transaction; handle QMI protocol - * errors */ - if (!qmi_message_get_response_result (message, &error)) { - transaction_complete_and_free (tr, NULL, error); - g_error_free (error); - } else { - /* Report the reply message */ - transaction_complete_and_free (tr, message, NULL); - } - } + else + /* Report the reply message */ + transaction_complete_and_free (tr, message, NULL); + return; } diff --git a/src/qmi-message-ctl.c b/src/qmi-message-ctl.c index 35f8c34..b8a7038 100644 --- a/src/qmi-message-ctl.c +++ b/src/qmi-message-ctl.c @@ -158,6 +158,10 @@ qmi_message_ctl_version_info_reply_parse (QmiMessage *self, g_assert (qmi_message_get_message_id (self) == QMI_CTL_MESSAGE_GET_VERSION_INFO); + /* Abort if we got a QMI error reported */ + if (!qmi_message_get_response_result (self, error)) + return NULL; + if (!qmi_message_tlv_get_varlen (self, 0x01, &svcbuflen, @@ -241,6 +245,10 @@ qmi_message_ctl_allocate_cid_reply_parse (QmiMessage *self, g_assert (qmi_message_get_message_id (self) == QMI_CTL_MESSAGE_ALLOCATE_CLIENT_ID); + /* Abort if we got a QMI error reported */ + if (!qmi_message_get_response_result (self, error)) + return FALSE; + if (!qmi_message_tlv_get (self, 0x01, sizeof (id), &id, error)) { g_prefix_error (error, "Couldn't get TLV: "); return FALSE; @@ -295,6 +303,10 @@ qmi_message_ctl_release_cid_reply_parse (QmiMessage *self, g_assert (qmi_message_get_message_id (self) == QMI_CTL_MESSAGE_RELEASE_CLIENT_ID); + /* Abort if we got a QMI error reported */ + if (!qmi_message_get_response_result (self, error)) + return FALSE; + if (!qmi_message_tlv_get (self, 0x01, sizeof (id), &id, error)) { g_prefix_error (error, "Couldn't get TLV: "); return FALSE; diff --git a/src/qmi-message-dms.c b/src/qmi-message-dms.c index 04050b9..54e5eb3 100644 --- a/src/qmi-message-dms.c +++ b/src/qmi-message-dms.c @@ -152,6 +152,10 @@ qmi_message_dms_get_ids_reply_parse (QmiMessage *self, g_assert (qmi_message_get_message_id (self) == QMI_DMS_MESSAGE_GET_IDS); + /* Abort if we got a QMI error reported */ + if (!qmi_message_get_response_result (self, error)) + return NULL; + got_esn = qmi_message_tlv_get_string (self, QMI_DMS_TLV_GET_IDS_ESN, NULL); |