calypsomodem: remove NULL check
authorJeevaka Badrappan <jeevaka.badrappan@elektrobit.com>
Sat, 29 Jan 2011 13:34:36 +0000 (05:34 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 29 Jan 2011 17:39:37 +0000 (18:39 +0100)
drivers/calypsomodem/stk.c
drivers/calypsomodem/voicecall.c

index 196b9e3..83287f9 100644 (file)
@@ -101,7 +101,7 @@ static void calypso_stk_envelope(struct ofono_stk *stk, int length,
 
        DBG("");
 
-       if (cbd == NULL || buf == NULL)
+       if (buf == NULL)
                goto error;
 
        len = sprintf(buf, "AT%%SATE=\"");
@@ -148,7 +148,7 @@ static void calypso_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=\"");
index 204ed14..01be990 100644 (file)
@@ -64,14 +64,10 @@ static void calypso_template(struct ofono_voicecall *vc, const char *cmd,
        struct voicecall_data *vd = ofono_voicecall_get_data(vc);
        struct cb_data *cbd = cb_data_new(cb, data);
 
-       if (cbd == NULL)
-               goto error;
-
        if (g_at_chat_send(vd->chat, cmd, none_prefix,
                                calypso_generic_cb, cbd, g_free) > 0)
                return;
 
-error:
        g_free(cbd);
 
        CALLBACK_WITH_FAILURE(cb, data);