summaryrefslogtreecommitdiffstats
path: root/drivers/atmodem/network-registration.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/atmodem/network-registration.c')
-rw-r--r--drivers/atmodem/network-registration.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/atmodem/network-registration.c b/drivers/atmodem/network-registration.c
index b8ec012c..04cd226e 100644
--- a/drivers/atmodem/network-registration.c
+++ b/drivers/atmodem/network-registration.c
@@ -1083,12 +1083,12 @@ static int at_netreg_probe(struct ofono_netreg *netreg, unsigned int vendor,
nd = g_new0(struct netreg_data, 1);
- nd->chat = chat;
+ nd->chat = g_at_chat_clone(chat);
nd->vendor = vendor;
nd->tech = -1;
ofono_netreg_set_data(netreg, nd);
- g_at_chat_send(chat, "AT+CREG=?", creg_prefix,
+ g_at_chat_send(nd->chat, "AT+CREG=?", creg_prefix,
at_creg_test_cb, netreg, NULL);
return 0;
@@ -1100,6 +1100,7 @@ static void at_netreg_remove(struct ofono_netreg *netreg)
ofono_netreg_set_data(netreg, NULL);
+ g_at_chat_unref(nd->chat);
g_free(nd);
}