diff options
author | Amol Lad <amol.lad@4rf.com> | 2019-11-23 14:57:48 +0530 |
---|---|---|
committer | Amol Lad <amol.lad@4rf.com> | 2019-11-23 14:57:48 +0530 |
commit | 7297b3fc90ec06023194aceae67e1c60e88801d4 (patch) | |
tree | 39f9f5217a0e0fed8aee741fa090e3f15c8fdd81 /src/mm-port-mbim.c | |
parent | 913f0d638d5380658c1ef008af67a69953323273 (diff) |
mbim: release all allocated CIDs during shutdown
Diffstat (limited to 'src/mm-port-mbim.c')
-rw-r--r-- | src/mm-port-mbim.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mm-port-mbim.c b/src/mm-port-mbim.c index dbc70fef..51f6fb7a 100644 --- a/src/mm-port-mbim.c +++ b/src/mm-port-mbim.c @@ -424,6 +424,20 @@ mm_port_mbim_close (MMPortMbim *self, #if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED if (self->priv->qmi_device) { GError *error = NULL; + GList *l; + + /* Release all allocated clients */ + for (l = self->priv->qmi_clients; l; l = g_list_next (l)) { + QmiClient *qmi_client = QMI_CLIENT (l->data); + + mm_dbg ("Releasing client for service '%s'...", qmi_service_get_string (qmi_client_get_service (qmi_client))); + qmi_device_release_client (self->priv->qmi_device, + qmi_client, + QMI_DEVICE_RELEASE_CLIENT_FLAGS_RELEASE_CID, + 3, NULL, NULL, NULL); + } + g_list_free_full (self->priv->qmi_clients, g_object_unref); + self->priv->qmi_clients = NULL; if (!qmi_device_close (self->priv->qmi_device, &error)) { mm_warn ("Couldn't properly close QMI device: %s", error->message); |