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