diff options
author | Simon Fels <simon.fels@canonical.com> | 2015-11-20 09:36:54 +0100 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2015-11-29 16:01:26 -0600 |
commit | 06480bdf536cfb8f64a76155559893cadcfaf276 (patch) | |
tree | ff02f7222c2fbbbc6ef8664c8a71118e1b9588b1 | |
parent | 1c9ed8af0e7a4a7bac505ff74eb874593a3adb3e (diff) | |
download | ofono-06480bdf536cfb8f64a76155559893cadcfaf276.tar.bz2 |
voicecall: don't dereference a supplied null value
When the voicecall atom is unregistered we remove all HFP support as
well but were supplying a zero as value to the emulator status
callbacks which caused the process to crash as we were dereferencing
the supplied value always and not respecting a zero as indicator to
reset.
-rw-r--r-- | src/voicecall.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/voicecall.c b/src/voicecall.c index b0882391..c9b1b435 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -2665,16 +2665,25 @@ static void emulator_hfp_unregister(struct ofono_atom *atom) struct ofono_voicecall *vc = __ofono_atom_get_data(atom); struct ofono_modem *modem = __ofono_atom_get_modem(atom); + struct emulator_status data; + data.vc = vc; + + data.status = OFONO_EMULATOR_CALL_INACTIVE; __ofono_modem_foreach_registered_atom(modem, OFONO_ATOM_TYPE_EMULATOR_HFP, - emulator_call_status_cb, 0); + emulator_call_status_cb, &data); + + data.status = OFONO_EMULATOR_CALLSETUP_INACTIVE; __ofono_modem_foreach_registered_atom(modem, OFONO_ATOM_TYPE_EMULATOR_HFP, emulator_callsetup_status_cb, - 0); + &data); + + data.status = OFONO_EMULATOR_CALLHELD_NONE; __ofono_modem_foreach_registered_atom(modem, OFONO_ATOM_TYPE_EMULATOR_HFP, - emulator_callheld_status_cb, 0); + emulator_callheld_status_cb, + &data); __ofono_modem_foreach_registered_atom(modem, OFONO_ATOM_TYPE_EMULATOR_HFP, |