diff --git a/plugins/gobi.c b/plugins/gobi.c index 5846485c..16bb0ed1 100644 --- a/plugins/gobi.c +++ b/plugins/gobi.c @@ -251,7 +251,7 @@ static void gobi_set_online(struct ofono_modem *modem, ofono_bool_t online, DBG("modem %p %s", modem, online ? "online" : "offline"); - if (cbd == NULL || data->chat == NULL) + if (data->chat == NULL) goto error; if (g_at_chat_send(data->chat, command, NULL, diff --git a/plugins/hso.c b/plugins/hso.c index 990be6d9..4594c52b 100644 --- a/plugins/hso.c +++ b/plugins/hso.c @@ -346,13 +346,9 @@ static void hso_set_online(struct ofono_modem *modem, ofono_bool_t online, DBG("modem %p %s", modem, online ? "online" : "offline"); - if (cbd == NULL) - goto error; - if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free)) return; -error: g_free(cbd); CALLBACK_WITH_FAILURE(cb, cbd->data); diff --git a/plugins/ifx.c b/plugins/ifx.c index 79cd150a..411c0120 100644 --- a/plugins/ifx.c +++ b/plugins/ifx.c @@ -661,14 +661,10 @@ static void ifx_set_online(struct ofono_modem *modem, ofono_bool_t online, DBG("%p %s", modem, online ? "online" : "offline"); - if (cbd == NULL) - goto error; - if (g_at_chat_send(data->dlcs[AUX_DLC], command, NULL, set_online_cb, cbd, g_free) > 0) return; -error: g_free(cbd); CALLBACK_WITH_FAILURE(cb, cbd->data); diff --git a/plugins/mbm.c b/plugins/mbm.c index e8262407..600b3580 100644 --- a/plugins/mbm.c +++ b/plugins/mbm.c @@ -470,13 +470,9 @@ static void mbm_set_online(struct ofono_modem *modem, ofono_bool_t online, DBG("modem %p %s", modem, online ? "online" : "offline"); - if (cbd == NULL) - goto error; - if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free)) return; -error: g_free(cbd); CALLBACK_WITH_FAILURE(cb, cbd->data); diff --git a/plugins/novatel.c b/plugins/novatel.c index fbd12166..1948c498 100644 --- a/plugins/novatel.c +++ b/plugins/novatel.c @@ -309,7 +309,7 @@ static void novatel_set_online(struct ofono_modem *modem, ofono_bool_t online, DBG("modem %p %s", modem, online ? "online" : "offline"); - if (cbd == NULL || chat == NULL) + if (chat == NULL) goto error; if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free)) diff --git a/plugins/phonesim.c b/plugins/phonesim.c index 28306b50..2b36fe0c 100644 --- a/plugins/phonesim.c +++ b/plugins/phonesim.c @@ -143,9 +143,6 @@ static void phonesim_deactivate_primary(struct ofono_gprs_context *gc, struct cb_data *cbd = cb_data_new(cb, data); char buf[128]; - if (cbd == NULL) - goto error; - cbd->user = gc; snprintf(buf, sizeof(buf), "AT+CGACT=0,%u", id); @@ -154,7 +151,6 @@ static void phonesim_deactivate_primary(struct ofono_gprs_context *gc, at_cgact_down_cb, cbd, g_free) > 0) return; -error: g_free(cbd); CALLBACK_WITH_FAILURE(cb, data); @@ -273,14 +269,10 @@ static void phonesim_ctm_query(struct ofono_ctm *ctm, DBG(""); - if (!cbd) - goto error; - if (g_at_chat_send(chat, "AT+PTTY?", ptty_prefix, ctm_query_cb, cbd, g_free) > 0) return; -error: g_free(cbd); CALLBACK_WITH_FAILURE(cb, 0, data); @@ -305,16 +297,12 @@ static void phonesim_ctm_set(struct ofono_ctm *ctm, ofono_bool_t enable, DBG(""); - if (!cbd) - goto error; - snprintf(buf, sizeof(buf), "AT+PTTY=%d", enable); if (g_at_chat_send(chat, buf, none_prefix, ctm_set_cb, cbd, g_free) > 0) return; -error: CALLBACK_WITH_FAILURE(cb, data); g_free(cbd); } diff --git a/plugins/sierra.c b/plugins/sierra.c index b3edcf4c..f387b985 100644 --- a/plugins/sierra.c +++ b/plugins/sierra.c @@ -195,7 +195,7 @@ static void sierra_set_online(struct ofono_modem *modem, ofono_bool_t online, DBG("modem %p %s", modem, online ? "online" : "offline"); - if (cbd == NULL || data->chat == NULL) + if (data->chat == NULL) goto error; if (g_at_chat_send(data->chat, command, NULL, diff --git a/plugins/ste.c b/plugins/ste.c index 6b44780c..0b02a0de 100644 --- a/plugins/ste.c +++ b/plugins/ste.c @@ -320,13 +320,9 @@ static void ste_set_online(struct ofono_modem *modem, ofono_bool_t online, DBG("modem %p %s", modem, online ? "online" : "offline"); - if (cbd == NULL) - goto error; - if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free)) return; -error: g_free(cbd); CALLBACK_WITH_FAILURE(cb, cbd->data); diff --git a/plugins/tc65.c b/plugins/tc65.c index 60f66e70..f58f33de 100644 --- a/plugins/tc65.c +++ b/plugins/tc65.c @@ -159,13 +159,9 @@ static void tc65_set_online(struct ofono_modem *modem, ofono_bool_t online, DBG("modem %p %s", modem, online ? "online" : "offline"); - if (cbd == NULL) - goto error; - if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free)) return; -error: g_free(cbd); CALLBACK_WITH_FAILURE(cb, cbd->data); diff --git a/plugins/zte.c b/plugins/zte.c index 4693d933..822098d4 100644 --- a/plugins/zte.c +++ b/plugins/zte.c @@ -250,7 +250,7 @@ static void zte_set_online(struct ofono_modem *modem, ofono_bool_t online, DBG("modem %p %s", modem, online ? "online" : "offline"); - if (cbd == NULL || chat == NULL) + if (chat == NULL) goto error; if (g_at_chat_send(chat, command, NULL, set_online_cb, cbd, g_free))