diff options
author | Daniele Palmas <dnlplm@gmail.com> | 2021-10-08 11:42:04 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-10-11 16:02:40 +0000 |
commit | 41482d823b8d03520a284a6fe2263aeaf9f30c46 (patch) | |
tree | 931e687d4e7c6a4f679df7fca505d1b1b8fca95d | |
parent | 176b3f53c29a43232fdd752343eae042cbeff394 (diff) |
telit: fix segmentation fault in initialize_alternate_3g_band
Fix the following segmentation fault:
ModemManager[128007]: mm_port_peek_kernel_device: assertion 'MM_IS_PORT (self)' failed
Thread 1 "ModemManager" received signal SIGSEGV, Segmentation fault.
0x00005555556c6e3e in mm_kernel_device_get_global_property
(self=0x0, property=0x7ffff5947480 "ID_MM_TELIT_BND_ALTERNATE")
at kerneldevice/mm-kernel-device.c:309
Reported by Carlo Lobrano <c.lobrano@gmail.com>
-rw-r--r-- | plugins/telit/mm-shared-telit.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/telit/mm-shared-telit.c b/plugins/telit/mm-shared-telit.c index 9a5aa838..f32bf9af 100644 --- a/plugins/telit/mm-shared-telit.c +++ b/plugins/telit/mm-shared-telit.c @@ -58,12 +58,14 @@ initialize_alternate_3g_band (MMSharedTelit *self, MMKernelDevice *port; primary = MM_PORT (mm_base_modem_peek_port_primary (MM_BASE_MODEM (self))); - port = mm_port_peek_kernel_device (primary); + if (primary) { + port = mm_port_peek_kernel_device (primary); - /* Lookup for the tag specifying that we're using the alternate 3G band mapping */ - priv->alternate_3g_bands = mm_kernel_device_get_global_property_as_boolean (port, "ID_MM_TELIT_BND_ALTERNATE"); - if (priv->alternate_3g_bands) - mm_obj_dbg (self, "telit modem using alternate 3G band mask setup"); + /* Lookup for the tag specifying that we're using the alternate 3G band mapping */ + priv->alternate_3g_bands = mm_kernel_device_get_global_property_as_boolean (port, "ID_MM_TELIT_BND_ALTERNATE"); + if (priv->alternate_3g_bands) + mm_obj_dbg (self, "telit modem using alternate 3G band mask setup"); + } } static Private * |