From 3216e7a21aa4ac07467c47c30acf961476189ac8 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 11 Jan 2022 11:49:49 +0100 Subject: [PATCH] broadband-modem-qmi: don't pass full reference to signal handlers As in the case of the timeouts, we should not pass a full reference as data to the signal handler as we don't know how many times we'll receive the signal or if we'll ever receive it. We already make sure that the signal handler is disconnected when the operation ends, so we can be sure the self pointer is valid while the signal handler is connected. --- src/mm-broadband-modem-qmi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c index 0c6c9e08..fb592e16 100644 --- a/src/mm-broadband-modem-qmi.c +++ b/src/mm-broadband-modem-qmi.c @@ -1793,7 +1793,6 @@ power_event_report_indication_cb (QmiClientDms *client, MM_CORE_ERROR_FAILED, "Invalid power indication received"); dms_set_operating_mode_complete (self, error); - g_object_unref (self); return; } @@ -1804,7 +1803,6 @@ power_event_report_indication_cb (QmiClientDms *client, if (mode == state) { mm_obj_dbg (self, "Requested mode and mode received by indication matched"); dms_set_operating_mode_complete (self, NULL); - g_object_unref (self); return; } @@ -1812,7 +1810,6 @@ power_event_report_indication_cb (QmiClientDms *client, MM_CORE_ERROR_FAILED, "Requested mode and mode received by indication did not match"); dms_set_operating_mode_complete (self, error); - g_object_unref (self); } static void @@ -1932,7 +1929,7 @@ dms_set_event_report_operating_mode_activate_ready (QmiClientDms *client, g_signal_connect (client, "event-report", G_CALLBACK (power_event_report_indication_cb), - g_object_ref (self)); + self); g_assert (self->priv->set_operating_mode_task != NULL); mm_obj_dbg (self, "Power operation is pending");