diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2011-07-27 15:37:21 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-07-27 15:37:21 +0200 |
commit | 6d9d9558fb4ec53ff82ec0253e4dfbff3ef93704 (patch) | |
tree | 9cc9a5d274388482b9ef408cb73acba7c197a2ae /plugins/nokia.c | |
parent | c6c7fc3b16371c3a5a8453e7d7332518d8311f80 (diff) | |
download | ofono-6d9d9558fb4ec53ff82ec0253e4dfbff3ef93704.tar.bz2 |
nokia: Remove some unneeded NULL pointer checks
Diffstat (limited to 'plugins/nokia.c')
-rw-r--r-- | plugins/nokia.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/plugins/nokia.c b/plugins/nokia.c index 889f28ef..5dc0db86 100644 --- a/plugins/nokia.c +++ b/plugins/nokia.c @@ -23,7 +23,6 @@ #include <config.h> #endif -#include <stdio.h> #include <errno.h> #include <stdlib.h> @@ -107,6 +106,7 @@ static GAtChat *open_device(struct ofono_modem *modem, syntax = g_at_syntax_new_gsm_permissive(); chat = g_at_chat_new(channel, syntax); g_at_syntax_unref(syntax); + g_io_channel_unref(channel); if (chat == NULL) @@ -172,9 +172,6 @@ static void cfun_disable(gboolean ok, GAtResult *result, gpointer user_data) DBG(""); - g_at_chat_unref(data->modem); - data->modem = NULL; - g_at_chat_unref(data->control); data->control = NULL; @@ -188,18 +185,15 @@ static int nokia_disable(struct ofono_modem *modem) DBG("%p", modem); - if (data->modem) { - g_at_chat_cancel_all(data->modem); - g_at_chat_unregister_all(data->modem); - g_at_chat_unref(data->modem); - data->modem = NULL; - } + g_at_chat_cancel_all(data->modem); + g_at_chat_unregister_all(data->modem); - if (data->control == NULL) - return 0; + g_at_chat_unref(data->modem); + data->modem = NULL; g_at_chat_cancel_all(data->control); g_at_chat_unregister_all(data->control); + g_at_chat_send(data->control, "AT+CFUN=4", none_prefix, cfun_disable, modem, NULL); |