summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meson.build2
-rw-r--r--src/libqmi-glib/test/test-fixture.c1
-rw-r--r--src/qmicli/qmicli-dms.c31
-rw-r--r--src/qmicli/qmicli-ims.c6
-rw-r--r--src/qmicli/qmicli-nas.c1
-rw-r--r--src/qmicli/qmicli-pdc.c1
-rw-r--r--src/qmicli/qmicli-uim.c8
-rw-r--r--src/qmicli/qmicli-wds.c31
-rw-r--r--utils/swi-update.c2
9 files changed, 44 insertions, 39 deletions
diff --git a/meson.build b/meson.build
index d79a0ad..3aae86c 100644
--- a/meson.build
+++ b/meson.build
@@ -3,7 +3,7 @@
project(
'libqmi', 'c',
- version: '1.35.3',
+ version: '1.35.4',
license: 'GPL2',
default_options: [
'buildtype=debugoptimized',
diff --git a/src/libqmi-glib/test/test-fixture.c b/src/libqmi-glib/test/test-fixture.c
index cfbc2b4..32049c6 100644
--- a/src/libqmi-glib/test/test-fixture.c
+++ b/src/libqmi-glib/test/test-fixture.c
@@ -51,6 +51,7 @@ device_allocate_client_ready (QmiDevice *device,
service = qmi_client_get_service (client);
g_assert (service > QMI_SERVICE_CTL);
+ g_assert ((unsigned)service < G_N_ELEMENTS (fixture->service_info));
fixture->service_info[service].client = client;
fixture->service_info[service].transaction_id = 0x0001;
test_fixture_loop_stop (fixture);
diff --git a/src/qmicli/qmicli-dms.c b/src/qmicli/qmicli-dms.c
index 8108f0a..afba1e1 100644
--- a/src/qmicli/qmicli-dms.c
+++ b/src/qmicli/qmicli-dms.c
@@ -941,7 +941,7 @@ static QmiMessageDmsUimSetPinProtectionInput *
uim_set_pin_protection_input_create (const gchar *str)
{
QmiMessageDmsUimSetPinProtectionInput *input = NULL;
- gchar **split;
+ g_auto(GStrv) split = NULL;
QmiDmsUimPinId pin_id;
gboolean enable_disable;
gchar *current_pin;
@@ -970,7 +970,6 @@ uim_set_pin_protection_input_create (const gchar *str)
input = NULL;
}
}
- g_strfreev (split);
return input;
}
@@ -1030,7 +1029,7 @@ static QmiMessageDmsUimVerifyPinInput *
uim_verify_pin_input_create (const gchar *str)
{
QmiMessageDmsUimVerifyPinInput *input = NULL;
- gchar **split;
+ g_auto(GStrv) split = NULL;
QmiDmsUimPinId pin_id;
gchar *current_pin;
@@ -1056,7 +1055,6 @@ uim_verify_pin_input_create (const gchar *str)
input = NULL;
}
}
- g_strfreev (split);
return input;
}
@@ -1116,7 +1114,7 @@ static QmiMessageDmsUimUnblockPinInput *
uim_unblock_pin_input_create (const gchar *str)
{
QmiMessageDmsUimUnblockPinInput *input = NULL;
- gchar **split;
+ g_auto(GStrv) split = NULL;
QmiDmsUimPinId pin_id;
gchar *puk;
gchar *new_pin;
@@ -1145,7 +1143,6 @@ uim_unblock_pin_input_create (const gchar *str)
input = NULL;
}
}
- g_strfreev (split);
return input;
}
@@ -1205,7 +1202,7 @@ static QmiMessageDmsUimChangePinInput *
uim_change_pin_input_create (const gchar *str)
{
QmiMessageDmsUimChangePinInput *input = NULL;
- gchar **split;
+ g_auto(GStrv) split = NULL;
QmiDmsUimPinId pin_id;
gchar *old_pin;
gchar *new_pin;
@@ -1234,7 +1231,6 @@ uim_change_pin_input_create (const gchar *str)
input = NULL;
}
}
- g_strfreev (split);
return input;
}
@@ -1567,7 +1563,7 @@ static QmiMessageDmsUimSetCkProtectionInput *
uim_set_ck_protection_input_create (const gchar *str)
{
QmiMessageDmsUimSetCkProtectionInput *input = NULL;
- gchar **split;
+ g_auto(GStrv) split = NULL;
QmiDmsUimFacility facility;
gboolean enable_disable;
gchar *key;
@@ -1602,7 +1598,6 @@ uim_set_ck_protection_input_create (const gchar *str)
}
}
}
- g_strfreev (split);
return input;
}
@@ -1658,7 +1653,7 @@ static QmiMessageDmsUimUnblockCkInput *
uim_unblock_ck_input_create (const gchar *str)
{
QmiMessageDmsUimUnblockCkInput *input = NULL;
- gchar **split;
+ g_auto(GStrv) split = NULL;
QmiDmsUimFacility facility;
gchar *key;
@@ -1684,7 +1679,6 @@ uim_unblock_ck_input_create (const gchar *str)
input = NULL;
}
}
- g_strfreev (split);
return input;
}
@@ -2070,14 +2064,13 @@ static QmiMessageDmsActivateManualInput *
activate_manual_input_create (const gchar *str)
{
QmiMessageDmsActivateManualInput *input;
- gchar **split;
+ g_auto(GStrv) split = NULL;
GError *error = NULL;
gulong split_1_int;
split = g_strsplit (str, ",", -1);
if (g_strv_length (split) != 4) {
g_printerr ("error: incorrect number of arguments given\n");
- g_strfreev (split);
return NULL;
}
@@ -2103,7 +2096,6 @@ activate_manual_input_create (const gchar *str)
input = NULL;
}
- g_strfreev(split);
return input;
}
@@ -2236,7 +2228,7 @@ static QmiMessageDmsSetUserLockStateInput *
set_user_lock_state_input_create (const gchar *str)
{
QmiMessageDmsSetUserLockStateInput *input = NULL;
- gchar **split;
+ g_auto(GStrv) split = NULL;
gboolean enable_disable;
gchar *code;
@@ -2263,7 +2255,6 @@ set_user_lock_state_input_create (const gchar *str)
input = NULL;
}
}
- g_strfreev (split);
return input;
}
@@ -2306,7 +2297,7 @@ static QmiMessageDmsSetUserLockCodeInput *
set_user_lock_code_input_create (const gchar *str)
{
QmiMessageDmsSetUserLockCodeInput *input = NULL;
- gchar **split;
+ g_auto(GStrv) split = NULL;
gchar *old_code;
gchar *new_code;
@@ -2332,7 +2323,6 @@ set_user_lock_code_input_create (const gchar *str)
input = NULL;
}
}
- g_strfreev (split);
return input;
}
@@ -3146,6 +3136,7 @@ get_stored_image_list_stored_images_ready (QmiClientDms *client,
qmi_message_dms_list_stored_images_output_unref (output);
g_object_unref (task);
operation_shutdown (FALSE);
+ get_stored_image_result_free (result);
return;
}
@@ -3184,8 +3175,8 @@ get_stored_image (QmiClientDms *client,
gpointer user_data)
{
GetStoredImageContext *operation_ctx;
+ g_auto(GStrv) split = NULL;
GTask *task;
- gchar **split;
guint i = 0;
gint modem_index = -1;
gint pri_index = -1;
diff --git a/src/qmicli/qmicli-ims.c b/src/qmicli/qmicli-ims.c
index 880aeec..b690597 100644
--- a/src/qmicli/qmicli-ims.c
+++ b/src/qmicli/qmicli-ims.c
@@ -195,16 +195,16 @@ get_services_enabled_ready (QmiClientIms *client,
g_print ("[%s] IMS services:\n", qmi_device_get_path_display (ctx->device));
if (qmi_message_ims_get_ims_services_enabled_setting_output_get_ims_voice_service_enabled (output, &service_voice_enabled, NULL))
- g_print ("\t IMS registration enabled: %s\n", service_ims_registration_enabled? "yes" : "no");
+ g_print ("\t Voice service enabled: %s\n", service_voice_enabled? "yes" : "no");
if (qmi_message_ims_get_ims_services_enabled_setting_output_get_ims_video_telephony_service_enabled (output, &service_vt_enabled, NULL))
- g_print ("\t Voice service enabled: %s\n", service_voice_enabled? "yes" : "no");
+ g_print ("\tVideo Telephony service enabled: %s\n", service_vt_enabled? "yes" : "no");
if (qmi_message_ims_get_ims_services_enabled_setting_output_get_ims_voice_wifi_service_enabled (output, &service_voice_wifi_enabled, NULL))
g_print ("\t Voice WiFi service enabled: %s\n", service_voice_wifi_enabled? "yes" : "no");
if (qmi_message_ims_get_ims_services_enabled_setting_output_get_ims_registration_service_enabled (output, &service_ims_registration_enabled, NULL))
- g_print ("\tVideo Telephony service enabled: %s\n", service_vt_enabled? "yes" : "no");
+ g_print ("\t IMS registration enabled: %s\n", service_ims_registration_enabled? "yes" : "no");
if (qmi_message_ims_get_ims_services_enabled_setting_output_get_ims_ut_service_enabled (output, &service_ut_enabled, NULL))
g_print ("\t UE to TAS service enabled: %s\n", service_ut_enabled? "yes" : "no");
diff --git a/src/qmicli/qmicli-nas.c b/src/qmicli/qmicli-nas.c
index c51a5b0..7f69bfb 100644
--- a/src/qmicli/qmicli-nas.c
+++ b/src/qmicli/qmicli-nas.c
@@ -3837,6 +3837,7 @@ get_operator_name_ready (QmiClientNas *client,
element->lac1,
element->lac2,
element->plmn_name_record_identifier);
+ g_free(mnc);
}
}
diff --git a/src/qmicli/qmicli-pdc.c b/src/qmicli/qmicli-pdc.c
index 8139ef4..4e7a19c 100644
--- a/src/qmicli/qmicli-pdc.c
+++ b/src/qmicli/qmicli-pdc.c
@@ -1127,6 +1127,7 @@ load_config_file_from_string (const gchar *str)
hash_size = g_checksum_type_get_length (G_CHECKSUM_SHA1);
checksum = g_checksum_new (G_CHECKSUM_SHA1);
g_checksum_update (checksum, file_contents, file_size);
+ g_free (file_contents);
data = g_slice_new (LoadConfigFileData);
data->mapped_file = g_mapped_file_ref (mapped_file);
diff --git a/src/qmicli/qmicli-uim.c b/src/qmicli/qmicli-uim.c
index e344a68..2238c55 100644
--- a/src/qmicli/qmicli-uim.c
+++ b/src/qmicli/qmicli-uim.c
@@ -849,13 +849,13 @@ power_on_sim_input_create (const gchar *slot_str)
guint slot;
GError *error = NULL;
- input = qmi_message_uim_power_on_sim_input_new ();
-
if (!qmicli_read_uint_from_string (slot_str, &slot) || (slot > G_MAXUINT8)) {
g_printerr ("error: invalid slot number\n");
return NULL;
}
+ input = qmi_message_uim_power_on_sim_input_new ();
+
if (!qmi_message_uim_power_on_sim_input_set_slot (input, slot, &error)) {
g_printerr ("error: could not create SIM power on input: %s\n", error->message);
g_error_free (error);
@@ -907,13 +907,13 @@ power_off_sim_input_create (const gchar *slot_str)
guint slot;
GError *error = NULL;
- input = qmi_message_uim_power_off_sim_input_new ();
-
if (!qmicli_read_uint_from_string (slot_str, &slot) || (slot > G_MAXUINT8)) {
g_printerr ("error: invalid slot number\n");
return NULL;
}
+ input = qmi_message_uim_power_off_sim_input_new ();
+
if (!qmi_message_uim_power_off_sim_input_set_slot (input, slot, &error)) {
g_printerr ("error: could not create SIM power off input: %s\n", error->message);
g_error_free (error);
diff --git a/src/qmicli/qmicli-wds.c b/src/qmicli/qmicli-wds.c
index 66a9d7c..0bae3b4 100644
--- a/src/qmicli/qmicli-wds.c
+++ b/src/qmicli/qmicli-wds.c
@@ -3197,14 +3197,14 @@ qmicli_wds_run (QmiDevice *device,
#if defined HAVE_QMI_MESSAGE_WDS_SET_IP_FAMILY
if (set_ip_family_str) {
QmiMessageWdsSetIpFamilyInput *input;
+ QmiWdsIpFamily preference;
- input = qmi_message_wds_set_ip_family_input_new ();
switch (atoi (set_ip_family_str)) {
case 4:
- qmi_message_wds_set_ip_family_input_set_preference (input, QMI_WDS_IP_FAMILY_IPV4, NULL);
+ preference = QMI_WDS_IP_FAMILY_IPV4;
break;
case 6:
- qmi_message_wds_set_ip_family_input_set_preference (input, QMI_WDS_IP_FAMILY_IPV6, NULL);
+ preference = QMI_WDS_IP_FAMILY_IPV6;
break;
default:
g_printerr ("error: unknown IP type '%s' (not 4 or 6)\n",
@@ -3212,6 +3212,10 @@ qmicli_wds_run (QmiDevice *device,
operation_shutdown (FALSE);
return;
}
+
+ input = qmi_message_wds_set_ip_family_input_new ();
+ qmi_message_wds_set_ip_family_input_set_preference (input, preference, NULL);
+
g_debug ("Asynchronously set IP family...");
qmi_client_wds_set_ip_family (client,
input,
@@ -3441,7 +3445,6 @@ qmicli_wds_run (QmiDevice *device,
guint profile_index;
split = g_strsplit (delete_profile_str, ",", -1);
- input = qmi_message_wds_delete_profile_input_new ();
if (g_strv_length (split) != 2) {
g_printerr ("error: expected 2 arguments for delete profile command\n");
@@ -3471,6 +3474,8 @@ qmicli_wds_run (QmiDevice *device,
return;
}
+ input = qmi_message_wds_delete_profile_input_new ();
+
qmi_message_wds_delete_profile_input_set_profile_identifier (input, profile_type, (guint8)profile_index, NULL);
g_strfreev (split);
@@ -3490,12 +3495,12 @@ qmicli_wds_run (QmiDevice *device,
#if defined HAVE_QMI_MESSAGE_WDS_GET_PROFILE_LIST && defined HAVE_QMI_MESSAGE_WDS_GET_PROFILE_SETTINGS
if (get_profile_list_str) {
QmiMessageWdsGetProfileListInput *input;
+ QmiWdsProfileType profile_type;
- input = qmi_message_wds_get_profile_list_input_new ();
if (g_str_equal (get_profile_list_str, "3gpp"))
- qmi_message_wds_get_profile_list_input_set_profile_type (input, QMI_WDS_PROFILE_TYPE_3GPP, NULL);
+ profile_type = QMI_WDS_PROFILE_TYPE_3GPP;
else if (g_str_equal (get_profile_list_str, "3gpp2"))
- qmi_message_wds_get_profile_list_input_set_profile_type (input, QMI_WDS_PROFILE_TYPE_3GPP2, NULL);
+ profile_type = QMI_WDS_PROFILE_TYPE_3GPP2;
else {
g_printerr ("error: invalid profile type '%s'. Expected '3gpp' or '3gpp2'.'\n",
get_profile_list_str);
@@ -3503,6 +3508,9 @@ qmicli_wds_run (QmiDevice *device,
return;
}
+ input = qmi_message_wds_get_profile_list_input_new ();
+ qmi_message_wds_get_profile_list_input_set_profile_type (input, profile_type, NULL);
+
g_debug ("Asynchronously get profile list...");
qmi_client_wds_get_profile_list (ctx->client,
input,
@@ -3574,12 +3582,12 @@ qmicli_wds_run (QmiDevice *device,
#if defined HAVE_QMI_MESSAGE_WDS_GET_DEFAULT_SETTINGS
if (get_default_settings_str) {
QmiMessageWdsGetDefaultSettingsInput *input;
+ QmiWdsProfileType profile_type;
- input = qmi_message_wds_get_default_settings_input_new ();
if (g_str_equal (get_default_settings_str, "3gpp"))
- qmi_message_wds_get_default_settings_input_set_profile_type (input, QMI_WDS_PROFILE_TYPE_3GPP, NULL);
+ profile_type = QMI_WDS_PROFILE_TYPE_3GPP;
else if (g_str_equal (get_default_settings_str, "3gpp2"))
- qmi_message_wds_get_default_settings_input_set_profile_type (input, QMI_WDS_PROFILE_TYPE_3GPP2, NULL);
+ profile_type = QMI_WDS_PROFILE_TYPE_3GPP2;
else {
g_printerr ("error: invalid default type '%s'. Expected '3gpp' or '3gpp2'.'\n",
get_default_settings_str);
@@ -3587,6 +3595,9 @@ qmicli_wds_run (QmiDevice *device,
return;
}
+ input = qmi_message_wds_get_default_settings_input_new ();
+ qmi_message_wds_get_default_settings_input_set_profile_type (input, profile_type, NULL);
+
g_debug ("Asynchronously get default settings...");
qmi_client_wds_get_default_settings (ctx->client,
input,
diff --git a/utils/swi-update.c b/utils/swi-update.c
index 609c5ba..61cd71c 100644
--- a/utils/swi-update.c
+++ b/utils/swi-update.c
@@ -867,7 +867,7 @@ static int download_image(int serfd, char *buf, const char *image)
fprintf(stderr, "\n");
out:
- if (imgfd > 0)
+ if (imgfd >= 0)
close(imgfd);
return ret;
}