mirror of git://git.sysmocom.de/ofono
atmodem: Remove useless NULL checks before g_free
This commit is contained in:
parent
54c75c47f8
commit
a8d3e7433a
|
@ -96,7 +96,6 @@ static void at_call_barring_query(struct ofono_call_barring *cb,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(callback, 0, data);
|
||||
|
@ -139,7 +138,6 @@ static void at_call_barring_set(struct ofono_call_barring *cb, const char *lock,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(callback, data);
|
||||
|
@ -177,7 +175,6 @@ static void at_call_barring_set_passwd(struct ofono_call_barring *cb,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(callback, data);
|
||||
|
|
|
@ -143,7 +143,6 @@ static void at_ccfc_query(struct ofono_call_forwarding *cf, int type, int cls,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, 0, NULL, data);
|
||||
|
@ -174,7 +173,6 @@ static void at_ccfc_set(struct ofono_call_forwarding *cf, const char *buf,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
|
|
@ -125,7 +125,6 @@ static void at_caoc_query(struct ofono_call_meter *cm,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, -1, data);
|
||||
|
@ -147,7 +146,6 @@ static void at_cacm_query(struct ofono_call_meter *cm,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, -1, data);
|
||||
|
@ -181,7 +179,6 @@ static void at_cacm_set(struct ofono_call_meter *cm, const char *passwd,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -203,7 +200,6 @@ static void at_camm_query(struct ofono_call_meter *cm,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, -1, data);
|
||||
|
@ -227,7 +223,6 @@ static void at_camm_set(struct ofono_call_meter *cm,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -288,7 +283,6 @@ static void at_cpuc_query(struct ofono_call_meter *cm,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, 0, 0, data);
|
||||
|
@ -313,7 +307,6 @@ static void at_cpuc_set(struct ofono_call_meter *cm, const char *currency,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
|
|
@ -98,7 +98,6 @@ static void at_ccwa_query(struct ofono_call_settings *cs, int cls,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, 0, data);
|
||||
|
@ -132,7 +131,6 @@ static void at_ccwa_set(struct ofono_call_settings *cs, int mode, int cls,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -184,7 +182,6 @@ static void at_clip_query(struct ofono_call_settings *cs,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, -1, data);
|
||||
|
@ -235,7 +232,6 @@ static void at_colp_query(struct ofono_call_settings *cs,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, -1, data);
|
||||
|
@ -285,7 +281,6 @@ static void at_clir_query(struct ofono_call_settings *cs,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, -1, -1, data);
|
||||
|
@ -319,7 +314,6 @@ static void at_clir_set(struct ofono_call_settings *cs, int mode,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
|
|
@ -151,7 +151,6 @@ static void at_call_volume_speaker_volume(struct ofono_call_volume *cv,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -174,7 +173,6 @@ static void at_call_volume_mute(struct ofono_call_volume *cv, int muted,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
|
|
@ -137,7 +137,6 @@ static void at_cbs_set_topics(struct ofono_cbs *cbs, const char *topics,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, user_data);
|
||||
|
@ -163,7 +162,6 @@ static void at_cbs_clear_topics(struct ofono_cbs *cbs,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, user_data);
|
||||
|
|
|
@ -102,7 +102,6 @@ static void at_query_manufacturer(struct ofono_devinfo *info,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, NULL, data);
|
||||
|
@ -124,7 +123,6 @@ static void at_query_model(struct ofono_devinfo *info,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, NULL, data);
|
||||
|
@ -146,7 +144,6 @@ static void at_query_revision(struct ofono_devinfo *info,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, NULL, data);
|
||||
|
@ -168,7 +165,6 @@ static void at_query_serial(struct ofono_devinfo *info,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, NULL, data);
|
||||
|
|
|
@ -78,7 +78,6 @@ static void at_gprs_set_attached(struct ofono_gprs *gprs, int attached,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -136,7 +135,6 @@ static void at_gprs_registration_status(struct ofono_gprs *gprs,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, -1, data);
|
||||
|
|
|
@ -220,7 +220,6 @@ static void at_registration_status(struct ofono_netreg *netreg,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, -1, -1, -1, -1, data);
|
||||
|
@ -365,7 +364,6 @@ static void at_current_operator(struct ofono_netreg *netreg,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, NULL, data);
|
||||
|
@ -486,7 +484,6 @@ static void at_list_operators(struct ofono_netreg *netreg,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, 0, NULL, data);
|
||||
|
@ -517,7 +514,6 @@ static void at_register_auto(struct ofono_netreg *netreg,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -541,7 +537,6 @@ static void at_register_manual(struct ofono_netreg *netreg,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -561,7 +556,6 @@ static void at_deregister(struct ofono_netreg *netreg,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -758,7 +752,6 @@ static void at_signal_strength(struct ofono_netreg *netreg,
|
|||
}
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, -1, data);
|
||||
|
|
|
@ -380,7 +380,6 @@ static void at_export_entries(struct ofono_phonebook *pb, const char *storage,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
|
|
@ -212,7 +212,6 @@ static void at_sim_read_binary(struct ofono_sim *sim, int fileid,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, NULL, 0, data);
|
||||
|
@ -237,7 +236,6 @@ static void at_sim_read_record(struct ofono_sim *sim, int fileid,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, NULL, 0, data);
|
||||
|
@ -310,7 +308,6 @@ static void at_sim_update_binary(struct ofono_sim *sim, int fileid,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -344,7 +341,6 @@ static void at_sim_update_record(struct ofono_sim *sim, int fileid,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -376,7 +372,6 @@ static void at_sim_update_cyclic(struct ofono_sim *sim, int fileid,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -424,7 +419,6 @@ static void at_read_imsi(struct ofono_sim *sim, ofono_sim_imsi_cb_t cb,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, NULL, data);
|
||||
|
@ -523,7 +517,6 @@ static void at_pin_query(struct ofono_sim *sim, ofono_sim_passwd_cb_t cb,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, -1, data);
|
||||
|
@ -618,7 +611,6 @@ static void at_pin_send(struct ofono_sim *sim, const char *passwd,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -647,7 +639,6 @@ static void at_pin_send_puk(struct ofono_sim *sim, const char *puk,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -693,7 +684,6 @@ static void at_pin_enable(struct ofono_sim *sim,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -729,7 +719,6 @@ static void at_change_passwd(struct ofono_sim *sim,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -788,7 +777,6 @@ static void at_pin_query_enabled(struct ofono_sim *sim,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, -1, data);
|
||||
|
|
|
@ -116,7 +116,6 @@ static void at_csca_set(struct ofono_sms *sms,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, user_data);
|
||||
|
@ -182,7 +181,6 @@ static void at_csca_query(struct ofono_sms *sms, ofono_sms_sca_query_cb_t cb,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, NULL, user_data);
|
||||
|
@ -246,7 +244,6 @@ static void at_cmgs(struct ofono_sms *sms, unsigned char *pdu, int pdu_len,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, -1, user_data);
|
||||
|
@ -280,7 +277,6 @@ static void at_cgsms_set(struct ofono_sms *sms, int bearer,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, user_data);
|
||||
|
@ -331,7 +327,6 @@ static void at_cgsms_query(struct ofono_sms *sms,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, -1, user_data);
|
||||
|
@ -1227,7 +1222,6 @@ static void at_sms_remove(struct ofono_sms *sms)
|
|||
{
|
||||
struct sms_data *data = ofono_sms_get_data(sms);
|
||||
|
||||
if (data->cnma_ack_pdu)
|
||||
g_free(data->cnma_ack_pdu);
|
||||
|
||||
if (data->timeout_source > 0)
|
||||
|
|
|
@ -174,10 +174,7 @@ static void at_stk_envelope(struct ofono_stk *stk, int length,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (buf)
|
||||
g_free(buf);
|
||||
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, NULL, 0, data);
|
||||
|
@ -258,7 +255,6 @@ static void at_stk_terminal_response(struct ofono_stk *stk, int length,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
|
|
@ -100,7 +100,6 @@ static void cusd_parse(GAtResult *result, struct ofono_ussd *ussd)
|
|||
out:
|
||||
ofono_ussd_notify(ussd, status, converted);
|
||||
|
||||
if (converted)
|
||||
g_free(converted);
|
||||
}
|
||||
|
||||
|
@ -157,10 +156,7 @@ static void at_ussd_request(struct ofono_ussd *ussd, const char *str,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
if (converted)
|
||||
g_free(converted);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -191,7 +187,6 @@ static void at_ussd_cancel(struct ofono_ussd *ussd,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
|
|
@ -368,7 +368,6 @@ static void at_dial(struct ofono_voicecall *vc,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -394,7 +393,6 @@ static void at_template(const char *cmd, struct ofono_voicecall *vc,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (req)
|
||||
g_free(req);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -477,7 +475,6 @@ static void at_release_specific(struct ofono_voicecall *vc, int id,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (req)
|
||||
g_free(req);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -567,7 +564,6 @@ static void at_send_dtmf(struct ofono_voicecall *vc, const char *dtmf,
|
|||
return;
|
||||
|
||||
error:
|
||||
if (cbd)
|
||||
g_free(cbd);
|
||||
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
|
Loading…
Reference in New Issue