ifxmodem: remove NULL check

This commit is contained in:
Jeevaka Badrappan 2011-01-29 05:34:40 -08:00 committed by Marcel Holtmann
parent c00904e2d3
commit 52e46e42ff
3 changed files with 2 additions and 17 deletions

View File

@ -88,14 +88,10 @@ static void ifx_query_tty(struct ofono_ctm *ctm, ofono_ctm_query_cb_t cb,
struct ctm_data *ctmd = ofono_ctm_get_data(ctm);
struct cb_data *cbd = cb_data_new(cb, data);
if (cbd == NULL)
goto error;
if (g_at_chat_send(ctmd->chat, "AT+XCTMS?", xctms_prefix,
xctms_query_cb, cbd, g_free) > 0)
return;
error:
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, -1, data);
@ -121,9 +117,6 @@ static void ifx_set_tty(struct ofono_ctm *ctm, ofono_bool_t enable,
struct cb_data *cbd = cb_data_new(cb, data);
char buf[20];
if (cbd == NULL)
goto error;
/* Only FULL TTY mode enabled/disabled */
snprintf(buf, sizeof(buf), "AT+XCTMS=%i", enable ? 1 : 0);
@ -131,7 +124,6 @@ static void ifx_set_tty(struct ofono_ctm *ctm, ofono_bool_t enable,
xctms_modify_cb, cbd, g_free) > 0)
return;
error:
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, data);

View File

@ -104,7 +104,7 @@ static void ifx_stk_envelope(struct ofono_stk *stk, int length,
DBG("");
if (cbd == NULL || buf == NULL)
if (buf == NULL)
goto error;
len = sprintf(buf, "AT+SATE=\"");
@ -150,7 +150,7 @@ static void ifx_stk_terminal_response(struct ofono_stk *stk, int length,
DBG("");
if (cbd == NULL || buf == NULL)
if (buf == NULL)
goto error;
len = sprintf(buf, "AT+SATR=\"");

View File

@ -305,9 +305,6 @@ static void ifx_dial(struct ofono_voicecall *vc,
struct cb_data *cbd = cb_data_new(cb, data);
char buf[256];
if (cbd == NULL)
goto error;
cbd->user = vc;
if (ph->type == 145)
@ -332,7 +329,6 @@ static void ifx_dial(struct ofono_voicecall *vc,
atd_cb, cbd, g_free) > 0)
return;
error:
g_free(cbd);
CALLBACK_WITH_FAILURE(cb, data);
@ -504,9 +500,6 @@ static void ifx_send_dtmf(struct ofono_voicecall *vc, const char *dtmf,
int i;
char *buf;
if (cbd == NULL)
goto error;
/* strlen("+VTS=T\;") = 7 + initial AT + null */
buf = g_try_new(char, len * 7 + 3);
if (buf == NULL)