[PATCH] glib: remove invocations of g_type_init()

2017-02-02 Thread Ben Chan
g_type_init() has been deprecated (and also marked with the attribute 'deprecated') since glib 2.36 as the type system is automatically initialized. Since the minimum version of glib required by ModemManager is 2.36, calling g_type_init() isn't necessarily in the ModemManager code. ---

[PATCH] ublox: fix uninitialized variable issue

2017-01-23 Thread Ben Chan
This patch fixes an uninitialized variable issue in mm_ublox_parse_ugcntrd_response_for_cid(), which uses an uninitialized `match_info' when `in_cid' is invalid. --- plugins/ublox/mm-modem-helpers-ublox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 0/3] a crash related to NULL physdev

2017-02-23 Thread Ben Chan
separate mainly because I'm not sure if I've missed anything. Please feel free to ignore the third patch if it doesn't make sense, or squash it into the second if you prefer. Thanks, Ben Ben Chan (3): kernel-device: handle SDIO device in find_physical_gudevdevice base-manager: handle NULL physical

Re: [PATCH 3/3] kernel-device: simplify handling of platform/pci/pnp/sdio parent

2017-02-23 Thread Ben Chan
On Thu, Feb 23, 2017 at 2:07 PM, Dan Williams <d...@redhat.com> wrote: > On Thu, 2017-02-23 at 11:45 -0800, Ben Chan wrote: > > This patch simplifies the handling of platform/pci/pnp/sdio device in > > find_physical_gudevdevice(). When the code finds the first parent

Re: [PATCH 3/3] kernel-device: simplify handling of platform/pci/pnp/sdio parent

2017-02-24 Thread Ben Chan
On Thu, Feb 23, 2017 at 2:11 PM, Ben Chan <benc...@chromium.org> wrote: > > > On Thu, Feb 23, 2017 at 2:07 PM, Dan Williams <d...@redhat.com> wrote: > >> On Thu, 2017-02-23 at 11:45 -0800, Ben Chan wrote: >> > This patch simplifies the h

crash in mm-device.c:modem_valid

2017-02-10 Thread Ben Chan
Hi Aleksander and Dan I encountered a crash in mm-device.c:modem_valid:345 where 'self->priv' seemed invalid, but 'modem' looked fine. As there is no code to clear the "notify::base-modem-valid" signal in MMDevice, I think MMDevice currently relies on auto disconnection of the signal when

Re: [PATCH] device: disconnect signal handlers when modem object removed

2017-02-13 Thread Ben Chan
thanks. lgtm. The g_signal_handler_is_connected check in clear_modem seems unnecessary though? On Mon, Feb 13, 2017 at 6:06 AM, Aleksander Morgado < aleksan...@aleksander.es> wrote: > Don't rely on the automatic disconnection of the signal as the last > reference of the modem object may

Re: [PATCH v2 2/2] kernel-device: use device sysfs if physdev sysfs isn't available

2017-03-01 Thread Ben Chan
Aleksander, does v2 match what you expect? On Tue, Feb 28, 2017 at 6:59 PM, Ben Chan <benc...@chromium.org> wrote: > find_device_by_physdev_uid() expects a non-NULL UID of the physical > device. However, mm_kernel_device_get_physdev_uid() could potentially > return NULL on MMK

[PATCH v2 1/2] kernel-device: handle SDIO device in find_physical_gudevdevice

2017-02-28 Thread Ben Chan
A few crashes have been observed in the field with the following signature: Thread 0 CRASHED [SIGSEGV @ 0x ] MAGIC SIGNATURE THREAD 0xf53ff5e8 (libglib-2.0.so.0.3600.4 -ghash.c:1732 ) g_str_hash 0xf53fe8c7 (libglib-2.0.so.0.3600.4 -ghash.c:365 ) g_hash_table_lookup 0xb953c3bd

[PATCH] telit: use g_assert instead of g_assert_true / g_assert_false

2017-01-11 Thread Ben Chan
`g_assert_true' and `g_assert_false' are defined in glib 2.38 or later. The minimum glib version currently required by ModemMamanger is 2.36. While `g_assert_true' and `g_assert_false' may be preferred over the more generic `g_assert', it seems like overkill to bump the minimum glib version

[PATCH 2/4] plugins: remove explicit GDestroyNotify cast on g_free / g_object_unref

2017-03-28 Thread Ben Chan
g_free and g_object_unref are in form of `void (*)(gpointer)`, which matches the GDestroyNotify signature. An explicit GDestroyNotify cast on g_free and g_object_unref is thus not needed. --- plugins/altair/mm-broadband-modem-altair-lte.c | 4 ++--

[PATCH 4/4] libmm-glib: remove explicit GDestroyNotify cast on g_object_unref

2017-03-28 Thread Ben Chan
g_object_unref is in form of `void (*)(gpointer)`, which matches the GDestroyNotify signature. An explicit GDestroyNotify cast on g_object_unref is thus not needed. --- libmm-glib/mm-modem-messaging.c | 4 ++-- libmm-glib/mm-modem-simple.c| 2 +- libmm-glib/mm-modem-voice.c | 4 ++--

Re: [PATCH] core: reset GList pointers to NULL when necessary

2017-03-29 Thread Ben Chan
btw, the g_list_free_full implementation seems to handle a NULL GList argument, but the glib doc doesn't explicitly mention that. I wonder if it's better to add `if (glist_ptr)` check anyway. On Tue, Mar 28, 2017 at 11:23 PM, Ben Chan <benc...@chromium.org> wrote: > Whe

[PATCH] core: reset GList pointers to NULL when necessary

2017-03-29 Thread Ben Chan
When calling g_list_free_full() to free a GList in dispose(), it is necessary to reset the GList pointer to NULL as dispose() may be called more than once. --- src/mm-call-list.c | 1 + src/mm-device.c| 2 ++ src/mm-sms-list.c | 1 + 3 files changed, 4 insertions(+) diff --git

[PATCH] base-bearer: fix typo in 'bearer-default-ip-family' property name

2017-03-28 Thread Ben Chan
--- src/mm-base-bearer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mm-base-bearer.h b/src/mm-base-bearer.h index 1e020dc6..0a94dcb6 100644 --- a/src/mm-base-bearer.h +++ b/src/mm-base-bearer.h @@ -59,7 +59,7 @@ typedef struct _MMBaseBearerPrivate MMBaseBearerPrivate;

[PATCH 2/2] novatel: port IMSI loading to use GTask

2017-04-03 Thread Ben Chan
--- plugins/novatel/mm-sim-novatel-lte.c | 89 +++- 1 file changed, 36 insertions(+), 53 deletions(-) diff --git a/plugins/novatel/mm-sim-novatel-lte.c b/plugins/novatel/mm-sim-novatel-lte.c index 41d30411..1088d0d0 100644 ---

[PATCH] novatel-lte: revert to original plugin library name

2017-04-03 Thread Ben Chan
Commit f9c63bfa0 "build,plugins: update build rules" accidentally changed the Novatel LTE plugin from 'libmm-plugins-novatel-lte.so' to 'libmm-plugins-novatel_lte.so'. The name becomes inconsistent with other plugin names. --- It probably doesn't matter how the plugin library is named, but the

[PATCH] iface-modem-simple: port register_in_3gpp_or_cdma_network to use GTask

2017-04-04 Thread Ben Chan
--- src/mm-iface-modem-simple.c | 59 ++--- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/src/mm-iface-modem-simple.c b/src/mm-iface-modem-simple.c index 572c4f92..a16adb19 100644 --- a/src/mm-iface-modem-simple.c +++

Re: [PATCH 1/2] novatel: port custom init to use GTask

2017-04-06 Thread Ben Chan
On Thu, Apr 6, 2017 at 11:36 AM, Aleksander Morgado <aleksan...@aleksander.es> wrote: > On 03/04/17 21:37, Ben Chan wrote: >> --- >> plugins/novatel/mm-common-novatel.c | 62 >> + >> 1 file changed, 29 insertions(+), 33 deletio

Re: Porting to GTask: pointer to self in context?

2017-04-06 Thread Ben Chan
On Thu, Apr 6, 2017 at 11:09 AM, Aleksander Morgado wrote: > Hey Ben, Dan and everyone else, > > Related to the ports to GTask sent by Ben... > > When using the GSimpleAsyncResult logic, I usually always added a full > reference to the "source object" of the async

[PATCH] sms-list: port mm_sms_list_delete_sms to use GTask

2017-04-06 Thread Ben Chan
--- src/mm-sms-list.c | 70 +-- 1 file changed, 27 insertions(+), 43 deletions(-) diff --git a/src/mm-sms-list.c b/src/mm-sms-list.c index 7819b3ad..22c2cd9a 100644 --- a/src/mm-sms-list.c +++ b/src/mm-sms-list.c @@ -113,28 +113,12 @@

[PATCH] novatel: obtain MMPortProbe from GTask source object

2017-04-06 Thread Ben Chan
The MMPortProbe object is already referenced by the GTask object for custom init. Instead of keeping another reference of MMPortProbe in the CustomInitContext, this patch changes the code to simply obtain it from the source object of GTask. See

[PATCH 2/2] sms-mbim: port sms_delete to use GTask

2017-04-06 Thread Ben Chan
--- src/mm-sms-mbim.c | 48 +++- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/src/mm-sms-mbim.c b/src/mm-sms-mbim.c index 085a2d59..99e0de74 100644 --- a/src/mm-sms-mbim.c +++ b/src/mm-sms-mbim.c @@ -207,22 +207,17 @@ sms_send

[PATCH 1/2] sms-mbim: port sms_send to use GTask

2017-04-06 Thread Ben Chan
--- src/mm-sms-mbim.c | 46 ++ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/src/mm-sms-mbim.c b/src/mm-sms-mbim.c index eded51fc..085a2d59 100644 --- a/src/mm-sms-mbim.c +++ b/src/mm-sms-mbim.c @@ -74,21 +74,16 @@ peek_device

[PATCH 1/2] auth: port authorize to use GTask

2017-04-06 Thread Ben Chan
--- src/mm-auth-provider.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/mm-auth-provider.c b/src/mm-auth-provider.c index 4ef56234..4d8766c0 100644 --- a/src/mm-auth-provider.c +++ b/src/mm-auth-provider.c @@ -75,15 +75,12 @@ authorize (MMAuthProvider *self,

[PATCH] call-list: port mm_call_list_delete_call to use GTask

2017-04-06 Thread Ben Chan
--- src/mm-call-list.c | 55 +++--- 1 file changed, 19 insertions(+), 36 deletions(-) diff --git a/src/mm-call-list.c b/src/mm-call-list.c index fae66035..1cc1f543 100644 --- a/src/mm-call-list.c +++ b/src/mm-call-list.c @@ -214,28 +214,12 @@

[PATCH] port-mbim: port mm_port_mbim_{open,close} to use GTask

2017-04-06 Thread Ben Chan
--- src/mm-port-mbim.c | 130 + 1 file changed, 50 insertions(+), 80 deletions(-) diff --git a/src/mm-port-mbim.c b/src/mm-port-mbim.c index 2b649963..5015c388 100644 --- a/src/mm-port-mbim.c +++ b/src/mm-port-mbim.c @@ -31,90 +31,58 @@ struct

[PATCH 1/2] port-qmi: port mm_port_qmi_open to use GTask

2017-04-06 Thread Ben Chan
--- src/mm-port-qmi.c | 142 +- 1 file changed, 76 insertions(+), 66 deletions(-) diff --git a/src/mm-port-qmi.c b/src/mm-port-qmi.c index eb163006..c6ae0615 100644 --- a/src/mm-port-qmi.c +++ b/src/mm-port-qmi.c @@ -188,9 +188,6 @@ typedef

[PATCH 2/2] port-qmi: port mm_port_qmi_allocate_client to use GTask

2017-04-06 Thread Ben Chan
--- src/mm-port-qmi.c | 51 ++- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/src/mm-port-qmi.c b/src/mm-port-qmi.c index c6ae0615..2baeea7c 100644 --- a/src/mm-port-qmi.c +++ b/src/mm-port-qmi.c @@ -73,21 +73,16 @@

[PATCH 2/3] iface-modem-signal: port mm_iface_modem_signal_enable to use GTask

2017-04-12 Thread Ben Chan
--- src/mm-iface-modem-signal.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/mm-iface-modem-signal.c b/src/mm-iface-modem-signal.c index fdfdc7e0..f8348831 100644 --- a/src/mm-iface-modem-signal.c +++ b/src/mm-iface-modem-signal.c @@ -330,7 +330,7 @@

[PATCH 3/3] iface-modem-signal: port mm_iface_modem_signal_initialize to use GTask

2017-04-12 Thread Ben Chan
--- src/mm-iface-modem-signal.c | 98 - 1 file changed, 44 insertions(+), 54 deletions(-) diff --git a/src/mm-iface-modem-signal.c b/src/mm-iface-modem-signal.c index f8348831..9751b5d6 100644 --- a/src/mm-iface-modem-signal.c +++

[PATCH 1/3] iface-modem-signal: port mm_modem_iface_signal_disable to use GTask

2017-04-12 Thread Ben Chan
--- src/mm-iface-modem-signal.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/mm-iface-modem-signal.c b/src/mm-iface-modem-signal.c index dbf11515..fdfdc7e0 100644 --- a/src/mm-iface-modem-signal.c +++ b/src/mm-iface-modem-signal.c @@ -306,7 +306,7 @@

[PATCH] device: add null check on `self->priv->modem' in clear_modem

2017-03-03 Thread Ben Chan
clear_modem() can be invoked from set_property() and dispose(), where `self->priv->modem' may be NULL. This patch adds a null check on the modem object to make sure we don't run g_object_run_dispose() on a null modem object. --- src/mm-device.c | 10 ++ 1 file changed, 6 insertions(+), 4

Re: [PATCH v2 2/2] kernel-device: use device sysfs if physdev sysfs isn't available

2017-03-02 Thread Ben Chan
On Thu, Mar 2, 2017 at 12:36 AM, Aleksander Morgado < aleksan...@aleksander.es> wrote: > On Wed, Mar 1, 2017 at 3:59 AM, Ben Chan <benc...@chromium.org> wrote: > > find_device_by_physdev_uid() expects a non-NULL UID of the physical > > device. However, mm_kernel_dev

Re: [PATCH] novatel: port custom init and IMSI loading to use GTask

2017-04-03 Thread Ben Chan
san...@aleksander.es> wrote: > > Hey Ben, > > Looks like these 2 things could really be split into 2 different > patches, could you do that? > > See other comments below inline. > > On Sat, Apr 1, 2017 at 8:05 PM, Ben Chan <benc...@chromium.org> wrote: > >

[PATCH 1/2] novatel: port custom init to use GTask

2017-04-03 Thread Ben Chan
--- plugins/novatel/mm-common-novatel.c | 62 + 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/plugins/novatel/mm-common-novatel.c b/plugins/novatel/mm-common-novatel.c index 4c39c7c7..a8f2da90 100644 --- a/plugins/novatel/mm-common-novatel.c

[PATCH] novatel: port custom init and IMSI loading to use GTask

2017-04-01 Thread Ben Chan
--- plugins/novatel/mm-common-novatel.c | 54 +++--- plugins/novatel/mm-sim-novatel-lte.c | 89 2 files changed, 66 insertions(+), 77 deletions(-) diff --git a/plugins/novatel/mm-common-novatel.c b/plugins/novatel/mm-common-novatel.c index

[PATCH] base-call: remove unnecessary string duplications

2017-04-07 Thread Ben Chan
--- src/mm-base-call.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/mm-base-call.c b/src/mm-base-call.c index 6ce85d0d..606d24f2 100644 --- a/src/mm-base-call.c +++ b/src/mm-base-call.c @@ -754,7 +754,6 @@ call_accept (MMBaseCall *self, gpointer

[PATCH v2] port-mbim: port mm_port_mbim_{open,close} to use GTask

2017-04-07 Thread Ben Chan
--- Good catch! src/mm-port-mbim.c | 132 + 1 file changed, 51 insertions(+), 81 deletions(-) diff --git a/src/mm-port-mbim.c b/src/mm-port-mbim.c index 2b649963..a0534fea 100644 --- a/src/mm-port-mbim.c +++ b/src/mm-port-mbim.c @@ -31,90

Re: [PATCH 2/2] port-qmi: port mm_port_qmi_allocate_client to use GTask

2017-04-07 Thread Ben Chan
On Fri, Apr 7, 2017 at 2:03 AM, Aleksander Morgado <aleksan...@aleksander.es> wrote: > Hey Ben, > > See comments below. > > On 06/04/17 22:41, Ben Chan wrote: >> --- >> src/mm-port-qmi.c | 51 ++- >> 1 file

[PATCH] altair-lte: don't use send-delay=0

2017-08-01 Thread Ben Chan
As observed on some modems, send-delay=0 seems to break port probing. --- plugins/altair/mm-plugin-altair-lte.c | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/altair/mm-plugin-altair-lte.c b/plugins/altair/mm-plugin-altair-lte.c index 2338502b..7f6a7c0b 100644 ---

[PATCH] huawei: ensure MMBearerConnectResult populated into GSimpleAsyncResult

2017-08-01 Thread Ben Chan
During the CONNECT_3GPP_CONTEXT_STEP_LAST step, connect_3gpp_context_step() conditionally creates and populates a MMBearerConnectResult object into the GSimpleAsyncResult object when the ipv4_config field of the Connect3gppContext struct is set. That assumes the ipv4_config field is always

[PATCH] sms-part-cdma: add missing break statements in cause_code_to_delivery_state

2017-08-02 Thread Ben Chan
This patch fixes cause_code_to_delivery_state() by adding two missing break statements for the case ERROR_CLASS_TEMPORARY and ERROR_CLASS_PERMANENT in the `switch (error_class)` statement. Without the break statements, the switch always falls through to the default and returns

[PATCH 3/5] call-list: remove unused variables

2017-08-02 Thread Ben Chan
--- src/mm-call-list.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/mm-call-list.c b/src/mm-call-list.c index 9457bb2b..3ca46bcc 100644 --- a/src/mm-call-list.c +++ b/src/mm-call-list.c @@ -88,9 +88,8 @@ MMBaseCall*

[PATCH 1/5] broadband-bearer: remove unused variable

2017-08-02 Thread Ben Chan
--- src/mm-broadband-bearer.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c index c4f92b99..0758f013 100644 --- a/src/mm-broadband-bearer.c +++ b/src/mm-broadband-bearer.c @@ -1417,11 +1417,9 @@ data_flash_cdma_ready (MMPortSerial

[PATCH 2/5] broadband-modem: remove unused variables

2017-08-02 Thread Ben Chan
--- src/mm-broadband-modem.c | 12 1 file changed, 12 deletions(-) diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index eb127b58..2bfc3382 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -1775,7 +1775,6 @@ signal_quality_csq_ready

[PATCH 5/5] ublox: remove unused variable

2017-08-02 Thread Ben Chan
--- plugins/ublox/mm-broadband-bearer-ublox.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/ublox/mm-broadband-bearer-ublox.c b/plugins/ublox/mm-broadband-bearer-ublox.c index 62f3d7ea..11911b25 100644 --- a/plugins/ublox/mm-broadband-bearer-ublox.c +++

[PATCH] libmm-glib,firmware: fix unique_id checks

2017-08-02 Thread Ben Chan
The following checks in mm_modem_firmware_select() and mm_modem_firmware_select_sync() could result in a NULL pointer dereference if `unique_id' is NULL: g_return_if_fail (unique_id != NULL || unique_id[0] == '\0') g_return_val_if_fail (unique_id != NULL || unique_id[0] == '\0', FALSE) This

[PATCH] novatel: avoid calling qcdm_result_unref on NULL QcdmResult

2017-08-02 Thread Ben Chan
--- plugins/novatel/mm-broadband-modem-novatel.c | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/novatel/mm-broadband-modem-novatel.c b/plugins/novatel/mm-broadband-modem-novatel.c index 88f0c36d..9c251573 100644 --- a/plugins/novatel/mm-broadband-modem-novatel.c +++

[PATCH] broadband-modem-mbim: remove unused variable

2017-08-03 Thread Ben Chan
--- src/mm-broadband-modem-mbim.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mm-broadband-modem-mbim.c b/src/mm-broadband-modem-mbim.c index 7f5d2fc8..815f5455 100644 --- a/src/mm-broadband-modem-mbim.c +++ b/src/mm-broadband-modem-mbim.c @@ -1547,11 +1547,9 @@

Re: [PATCH] altair-lte: don't use send-delay=0

2017-08-03 Thread Ben Chan
On Aug 3, 2017 3:35 AM, "Aleksander Morgado" <aleksan...@aleksander.es> wrote: On 02/08/17 07:16, Ben Chan wrote: > As observed on some modems, send-delay=0 seems to break port probing. > --- > plugins/altair/mm-plugin-altair-lte.c | 1 - > 1 file changed, 1 deletio

[PATCH] huawei: remove redundant call to huawei_parse_auth_type()

2017-08-03 Thread Ben Chan
This patch removes a redundant `encoded_auth = huawei_parse_auth_type (auth)` in connect_3gpp_context_step(). --- plugins/huawei/mm-broadband-bearer-huawei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/huawei/mm-broadband-bearer-huawei.c

[PATCH v2] broadband-modem-qmi: fix potential use-after-freed issues

2017-08-03 Thread Ben Chan
This patch fixes some potential use-after-freed issues in dms_get_ids_ready(). When an invalid ESN / MEID is retrieved, `ctx->self->priv->esn' / `ctx->self->priv->meid' is freed but not reset to NULL. If no IMEI is retrieved, `str' can be set to the already freed `ctx->self->priv->esn' /

[PATCH v2] location-gps-nmea: fix memory leaks

2017-08-03 Thread Ben Chan
There are potential memory leaks in MMLocationGpsNmea: - When the `trace' string provided to location_gps_nmea_take_trace() isn't added to the hash table, its ownership is still considered transferred. It should thus be freed. Similarly, the `trace_type' string isn't added the hash table

[PATCH] broadband-modem: fix an ineffective `g_assert (equip_id)'

2017-08-03 Thread Ben Chan
This patch fixes an ineffective `g_assert (equip_id)' in modem_load_equipment_identifier_finish(). After mm_parse_gsn() succeeds, `equip_id' is freed but not reset to NULL, so `g_assert (equip_id)' will never assert even if `imei', `meid', and `esn' are all NULL (though that shouldn't happen when

[PATCH 1/2] sim-qmi: remove unused variables

2017-08-03 Thread Ben Chan
--- src/mm-sim-qmi.c | 12 1 file changed, 12 deletions(-) diff --git a/src/mm-sim-qmi.c b/src/mm-sim-qmi.c index 2ae15147..725e073e 100644 --- a/src/mm-sim-qmi.c +++ b/src/mm-sim-qmi.c @@ -480,9 +480,6 @@ dms_uim_verify_pin_ready (QmiClientDms *client, {

[PATCH v2] altair-lte: don't use send-delay=0

2017-08-04 Thread Ben Chan
On the modem with firmware revision ALT3100_04_05_06_10_A8_TF (LTEUSB_02_04_05_10_53), it's observed that port probing doesn't complete successfully when send-delay=0 is used. --- plugins/altair/mm-plugin-altair-lte.c | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH v3] kernel-device: expect non-NULL 'vendor' and 'product' argument in get_device_ids()

2017-08-15 Thread Ben Chan
get_device_ids() in mm-kernel-device-udev.c accepts a NULL 'vendor' or 'product' argument, but the current implementation could result in a potential NULL dereferences of the 'vendor' argument. Given that get_device_ids() is a local helper and its only caller provides a non-NULL 'vendor' and

Re: [review] https://github.com/cbchan/ModemManager/tree/sim-mbim-unlock-retries

2017-08-10 Thread Ben Chan
On Thu, Aug 10, 2017 at 3:34 PM, Aleksander Morgado wrote: However, we may be able to improve the situation a bit when MM is running by making mm_iface_modem_update_lock_info preserve what we have learned from a prior MBIM_CID_PIN response. That's what

[PATCH v2] libmm-glib,sms-properties: fix potential NULL dereference

2017-08-11 Thread Ben Chan
This patch fixes a potential NULL referenece issue in mm_sms_properties_get_data() where it accesses `self->priv->data->data' when `self->priv->data' could be potentially NULL. --- libmm-glib/mm-sms-properties.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH] libmm-glib,cdma: fix potential NULL dereference

2017-08-11 Thread Ben Chan
This patch fixes a potential NULL referenece issue in mm_cdma_manual_activation_properties_get_prl() where it accesses `self->priv->prl->data' when `self->priv->prl' could be potentially NULL. --- libmm-glib/mm-cdma-manual-activation-properties.c | 7 --- 1 file changed, 4 insertions(+), 3

[PATCH v2] charset: fix mm_charset_get_encoded_len

2017-08-11 Thread Ben Chan
The while loop in mm_charset_get_encoded_len() iterates through each valid UTF-8 encoded character in the given NULL-terminated UTF-8 string. It uses g_utf8_find_next_char() to find the position of the next character. In case, g_utf8_find_next_char() returns NULL, it tries to find the end (i.e.

Re: [review] https://github.com/cbchan/ModemManager/tree/sim-mbim-unlock-retries

2017-08-10 Thread Ben Chan
On Thu, Aug 10, 2017 at 11:09 AM, Aleksander Morgado wrote: > Hey, > >>> >>> Hum... looks like the patched logic is actually way more confusing >>> than the original one... See attached logs (the -patched file is after >>> your changes). >>> >> >> Thanks for taking time

Re: [PATCH] charset: fix mm_charset_get_encoded_len

2017-08-11 Thread Ben Chan
On Fri, Aug 11, 2017 at 2:54 PM, Dan Williams <d...@redhat.com> wrote: > On Fri, 2017-08-11 at 13:27 -0700, Ben Chan wrote: > > The while loop in mm_charset_get_encoded_len() iterates through each > > valid UTF-8 encoded character in the given NULL-terminated UTF-8 &g

[PATCH 3/5] telit: remove unnecessary NULL checks for g_free / g_match_info_free

2017-07-12 Thread Ben Chan
g_free() and g_match_info_free() already check if the given pointer is NULL and does nothing on a NULL pointer. --- plugins/telit/mm-modem-helpers-telit.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/plugins/telit/mm-modem-helpers-telit.c

[PATCH 1/5] telit: remove unused 'flags' variable in mm_telit_get_4g_mm_bands

2017-07-12 Thread Ben Chan
--- plugins/telit/mm-modem-helpers-telit.c | 4 1 file changed, 4 deletions(-) diff --git a/plugins/telit/mm-modem-helpers-telit.c b/plugins/telit/mm-modem-helpers-telit.c index 3b227044..39e0d1bd 100644 --- a/plugins/telit/mm-modem-helpers-telit.c +++

[PATCH 2/5] telit: fix memory leak in mm_telit_get_4g_mm_bands

2017-07-12 Thread Ben Chan
--- plugins/telit/mm-modem-helpers-telit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/telit/mm-modem-helpers-telit.c b/plugins/telit/mm-modem-helpers-telit.c index 39e0d1bd..d0e50ab3 100644 --- a/plugins/telit/mm-modem-helpers-telit.c +++ b/plugins/telit/mm-modem-helpers-telit.c

[PATCH 4/5] telit: minor coding style fixes

2017-07-12 Thread Ben Chan
--- plugins/telit/mm-modem-helpers-telit.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/plugins/telit/mm-modem-helpers-telit.c b/plugins/telit/mm-modem-helpers-telit.c index 75667fd0..32663cdb 100644 ---

[PATCH 5/5] telit: fix memory leaks in unit tests

2017-07-12 Thread Ben Chan
--- plugins/telit/tests/test-mm-modem-helpers-telit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/telit/tests/test-mm-modem-helpers-telit.c b/plugins/telit/tests/test-mm-modem-helpers-telit.c index 1a43846d..5f8638bc 100644 ---

[PATCH] broadband-modem: rename load_power_state for consistency

2017-07-14 Thread Ben Chan
All MMIfaceModem functions implemented by MMBroadbandModem, except load_power_state, are prefixed with 'modem_'. For consistency, this patch renames load_power_state{,_finish} to modem_load_power_state{,_finish}. --- src/mm-broadband-modem.c | 18 +- 1 file changed, 9

[PATCH 4/5] sms-part-3gpp: minor coding style fixes

2017-07-14 Thread Ben Chan
--- src/mm-sms-part-3gpp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mm-sms-part-3gpp.c b/src/mm-sms-part-3gpp.c index b305be59..3f4d6c06 100644 --- a/src/mm-sms-part-3gpp.c +++ b/src/mm-sms-part-3gpp.c @@ -135,7 +135,7 @@ sms_decode_address (const guint8

[PATCH 2/5] base-call: minor coding style fixes

2017-07-14 Thread Ben Chan
--- src/mm-base-call.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mm-base-call.c b/src/mm-base-call.c index 9194f0d7..186a3998 100644 --- a/src/mm-base-call.c +++ b/src/mm-base-call.c @@ -378,7 +378,7 @@ handle_send_dtmf_context_free (HandleSendDtmfContext

[PATCH 5/5] modem-helpers: minor coding style fixes

2017-07-14 Thread Ben Chan
--- src/mm-modem-helpers.c | 6 +++--- src/mm-modem-helpers.h | 6 +++--- src/tests/test-modem-helpers.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index 5e257a87..3af3f2d5 100644 ---

[PATCH 1/5] base-manager: minor coding style fixes

2017-07-14 Thread Ben Chan
--- src/mm-base-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mm-base-manager.c b/src/mm-base-manager.c index 0c76fd2c..48e2f25d 100644 --- a/src/mm-base-manager.c +++ b/src/mm-base-manager.c @@ -694,7 +694,7 @@ set_logging_auth_ready (MMAuthProvider *authp,

Re: [review] https://github.com/cbchan/ModemManager/tree/gtask-broadband-modem

2017-07-17 Thread Ben Chan
On Mon, Jul 17, 2017 at 1:25 AM, Aleksander Morgado wrote: > On Mon, Jul 17, 2017 at 10:02 AM, Aleksander Morgado > wrote: >>> What you included here as a >>> snippet is a huge bug actually. >> >> Well, not that huge really... the only issue is

[PATCH 3/4] iface-modem: minor coding style fixes

2017-07-17 Thread Ben Chan
--- src/mm-iface-modem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 418de1c7..d59303a8 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -3201,7 +3201,7 @@ update_lock_info_context_step (GTask *task)

[PATCH 1/4] plugin-manager: minor coding style fixes

2017-07-17 Thread Ben Chan
--- src/mm-plugin-manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mm-plugin-manager.c b/src/mm-plugin-manager.c index 9239b7f7..47d162fb 100644 --- a/src/mm-plugin-manager.c +++ b/src/mm-plugin-manager.c @@ -95,7 +95,7 @@ plugin_manager_build_plugins_list

[PATCH 4/4] base-modem: minor coding style fixes

2017-07-17 Thread Ben Chan
--- src/mm-base-modem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mm-base-modem.c b/src/mm-base-modem.c index 29df53c3..f11b7da7 100644 --- a/src/mm-base-modem.c +++ b/src/mm-base-modem.c @@ -284,7 +284,7 @@ mm_base_modem_grab_port (MMBaseModem *self, }

[review] https://github.com/cbchan/ModemManager/tree/gtask-broadband-modem-mbim

2017-07-11 Thread Ben Chan
This branch contains a series of patches that port MMBroadbandModemMbim to use GTask: https://github.com/linux-mobile-broadband/ModemManager/compare/master...cbchan:gtask-broadband-modem-mbim Ben ___ ModemManager-devel mailing list

[PATCH] bearer-qmi: replace g_new + memcpy with g_memdup

2017-07-10 Thread Ben Chan
--- src/mm-bearer-qmi.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mm-bearer-qmi.c b/src/mm-bearer-qmi.c index 4d532274..c687db60 100644 --- a/src/mm-bearer-qmi.c +++ b/src/mm-bearer-qmi.c @@ -151,7 +151,6 @@ reload_stats_context_step (GTask *task) {

[PATCH] novatel-lte: check error returned by g_task_propagate_error instead

2017-07-06 Thread Ben Chan
When returning an enum value via g_task_return_int, some code assumes the enum value is always non-negative and thus considers that a negative value implies an error. This assumption could be invalidated if a negative value is later added to the enum. To make it less error prone to future changes,

[PATCH] cinterion: check error returned by g_task_propagate_error instead

2017-07-06 Thread Ben Chan
When returning an enum value via g_task_return_int, some code assumes the enum value is always non-negative and thus considers that a negative value implies an error. This assumption could be invalidated if a negative value is later added to the enum. To make it less error prone to future changes,

[PATCH v2] cinterion: check error returned by g_task_propagate_error instead

2017-07-06 Thread Ben Chan
When returning an enum value via g_task_return_int, some code assumes the enum value is always non-negative and thus considers that a negative value implies an error. This assumption could be invalidated if a negative value is later added to the enum. To make it less error prone to future changes,

Re: [PATCH] telit: fix modem_set_current_bands to use g_task_report_new_error

2017-07-18 Thread Ben Chan
On Tue, Jul 18, 2017 at 1:34 AM, Aleksander Morgado wrote: > On 18/07/17 10:27, Aleksander Morgado wrote: >> -g_simple_async_report_error_in_idle (G_OBJECT (self), >> - callback, >> -

[PATCH 2/3] iface-modem-time: fix update_network_timezone to use g_task_report_new_error

2017-07-17 Thread Ben Chan
Commit 7c5f308af ("iface-modem-time: port update_network_timezone to use GTask") ported most of the update_network_timezone code to use GTask, but missed a g_simple_async_report_error_in_idle call, which could potentially lead to an incorrect G_TASK cast. --- src/mm-iface-modem-time.c | 13

[PATCH 1/3] call-list: fix mm_call_list_delete_call to use g_task_report_new_error

2017-07-17 Thread Ben Chan
Commit a08064492 ("call-list: port mm_call_list_delete_call to use GTask") ported most of the mm_call_list_delete_call code to use GTask, but missed a g_simple_async_report_error_in_idle calls, which can potentially lead to an incorrect G_TASK cast in mm_call_list_delete_call_finish. ---

[PATCH 3/3] sms-mbim: fix peek_device to use g_task_report_new_error

2017-07-17 Thread Ben Chan
When porting MMSmsMbim to use GTask, peek_device wasn't modified to use g_task_report_new_error, which could potentially lead to an incorrect G_TASK cast. --- src/mm-sms-mbim.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mm-sms-mbim.c b/src/mm-sms-mbim.c

[review] https://github.com/cbchan/ModemManager/tree/gtask-broadband-modem

2017-07-17 Thread Ben Chan
This branch contains a series of patches that port MMBroadbandModemMbim to use GTask: https://github.com/linux-mobile-broadband/ModemManager/compare/master...cbchan:gtask-broadband-modem Ben ___ ModemManager-devel mailing list

Unexpected +CGDCONT? error: 'Sending command failed: 'Resource temporarily unavailable''

2017-07-20 Thread Ben Chan
Hi Aleksander, I'm looking into an issue with MMBroadbandBearer::cid_selection_3gpp: Looking for best CID... (ttyUSB3) device open count is 2 (open) (ttyUSB3): --> 'ATX4' (ttyUSB3): --> 'AT' (ttyUSB3): --> 'AT+CGDCONT?' loading signal quality... (ttyUSB3) device open count is 3 (open)

[PATCH] broadband-bearer: fix crm_range_ready

2017-07-18 Thread Ben Chan
crm_range_ready() misses a return statement after it invokes interface_initialization_step(), which will lead to an invalid access of the already freed InitAsyncContext. --- src/mm-broadband-bearer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mm-broadband-bearer.c

[review] https://github.com/cbchan/ModemManager/tree/gtask-plugins-altair-lte

2017-07-19 Thread Ben Chan
This branch contains a series of patches that port altair-lte plugin to use GTask: https://github.com/linux-mobile-broadband/ModemManager/compare/master...cbchan:gtask-plugins-altair-lte ___ ModemManager-devel mailing list

Re: [review] https://github.com/cbchan/ModemManager/tree/gtask-plugins-longcheer

2017-07-24 Thread Ben Chan
On Mon, Jul 24, 2017 at 2:11 AM, Aleksander Morgado < aleksan...@aleksander.es> wrote: > On Fri, Jul 21, 2017 at 6:04 PM, Ben Chan <benc...@chromium.org> wrote: > > > > This branch contains a series of patches that port longcheer plugin to > use > > GTask: >

[PATCH] bearer-mbim: avoid calling mbim_message_unref on NULL MbimMessage

2017-07-26 Thread Ben Chan
--- src/mm-bearer-mbim.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c index 439de812..63bb0579 100644 --- a/src/mm-bearer-mbim.c +++ b/src/mm-bearer-mbim.c @@ -173,7 +173,9 @@ packet_statistics_query_ready (MbimDevice *device,

Re: [review] https://github.com/cbchan/ModemManager/tree/gtask-broadband-bearer

2017-07-19 Thread Ben Chan
On Wed, Jul 19, 2017 at 5:17 AM, Aleksander Morgado <aleksan...@aleksander.es> wrote: > On Wed, Jul 19, 2017 at 8:23 AM, Ben Chan <benc...@chromium.org> wrote: >> This branch contains a series of patches that port MMBroadbandBearer >> to use GTask: >> >> ht

[review] https://github.com/cbchan/ModemManager/tree/gtask-plugins-zte

2017-07-19 Thread Ben Chan
This branch contains a series of patches that port zte plugin to use GTask: https://github.com/linux-mobile-broadband/ModemManager/compare/master...cbchan:gtask-plugins-zte ___ ModemManager-devel mailing list ModemManager-devel@lists.freedesktop.org

[PATCH 3/3] iface-modem-voice: port mm_iface_modem_voice_disable to use GTask

2017-06-28 Thread Ben Chan
--- src/mm-iface-modem-voice.c | 89 -- 1 file changed, 47 insertions(+), 42 deletions(-) diff --git a/src/mm-iface-modem-voice.c b/src/mm-iface-modem-voice.c index b075796b..73fb314a 100644 --- a/src/mm-iface-modem-voice.c +++

[PATCH 4/4] iface-modem-time: port update_network_timezone to use GTask

2017-06-28 Thread Ben Chan
--- src/mm-iface-modem-time.c | 120 +++--- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/src/mm-iface-modem-time.c b/src/mm-iface-modem-time.c index eec340ed..41ca2f0e 100644 --- a/src/mm-iface-modem-time.c +++ b/src/mm-iface-modem-time.c

[PATCH 2/4] iface-modem-time: port mm_iface_modem_time_enable to use GTask

2017-06-28 Thread Ben Chan
--- src/mm-iface-modem-time.c | 108 +- 1 file changed, 49 insertions(+), 59 deletions(-) diff --git a/src/mm-iface-modem-time.c b/src/mm-iface-modem-time.c index efb8d386..74e497e7 100644 --- a/src/mm-iface-modem-time.c +++ b/src/mm-iface-modem-time.c

[PATCH 1/4] iface-modem-time: port mm_iface_modem_time_initialize to use GTask

2017-06-28 Thread Ben Chan
--- src/mm-iface-modem-time.c | 93 --- 1 file changed, 40 insertions(+), 53 deletions(-) diff --git a/src/mm-iface-modem-time.c b/src/mm-iface-modem-time.c index 85588d3f..efb8d386 100644 --- a/src/mm-iface-modem-time.c +++ b/src/mm-iface-modem-time.c

[PATCH 2/3] iface-modem-voice: port mm_iface_modem_voice_enable to use GTask

2017-06-28 Thread Ben Chan
--- src/mm-iface-modem-voice.c | 108 - 1 file changed, 49 insertions(+), 59 deletions(-) diff --git a/src/mm-iface-modem-voice.c b/src/mm-iface-modem-voice.c index 2a93907f..b075796b 100644 --- a/src/mm-iface-modem-voice.c +++

  1   2   3   >