diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2011-07-27 15:46:30 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-07-27 15:47:16 +0200 |
commit | c3e78fc82769a0c92de408650c8b524b78f34739 (patch) | |
tree | b5111fd6f1579553e2769bdb8756b9cd9f4e92b6 /plugins/novatel.c | |
parent | 1a23051d0fc2d7fb20ba197f6fd0cd5f319bccfc (diff) | |
download | ofono-c3e78fc82769a0c92de408650c8b524b78f34739.tar.bz2 |
novatel: Fix missing error handling for CFUN failure
Diffstat (limited to 'plugins/novatel.c')
-rw-r--r-- | plugins/novatel.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/novatel.c b/plugins/novatel.c index f125aad9..8f05a857 100644 --- a/plugins/novatel.c +++ b/plugins/novatel.c @@ -23,7 +23,6 @@ #include <config.h> #endif -#include <stdio.h> #include <errno.h> #include <stdlib.h> @@ -124,9 +123,18 @@ static GAtChat *open_device(struct ofono_modem *modem, static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data) { struct ofono_modem *modem = user_data; + struct novatel_data *data = ofono_modem_get_data(modem); DBG(""); + if (!ok) { + g_at_chat_unref(data->secondary); + data->secondary = NULL; + + g_at_chat_unref(data->primary); + data->primary = NULL; + } + ofono_modem_set_powered(modem, ok); } |