diff options
author | Jeevaka Badrappan <jeevaka.badrappan@linux.intel.com> | 2011-07-15 09:29:27 -0700 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-07-15 11:35:13 -0500 |
commit | 213d70dca348ee89838cc2e95328bce75a29dc22 (patch) | |
tree | 61a2932d6edca81aad952ca38c45079f3915c7aa /src/stk.c | |
parent | c65903bddd554c0c1e2f97450e247da1b3fbbc0e (diff) | |
download | ofono-213d70dca348ee89838cc2e95328bce75a29dc22.tar.bz2 |
stk: Fix crash seen in stk_alpha_id_unset
If there is no default agent, then current agent also will
be NULL. So, call stk_agent_request_cancel only when there is a valid
current agent.
Diffstat (limited to 'src/stk.c')
-rw-r--r-- | src/stk.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -529,7 +529,12 @@ static void stk_alpha_id_set(struct ofono_stk *stk, static void stk_alpha_id_unset(struct ofono_stk *stk) { - stk_agent_request_cancel(stk->current_agent); + /* + * If there is no default agent, then current agent also will be NULL. + * So, call request cancel only when there is a valid current agent. + */ + if (stk->current_agent) + stk_agent_request_cancel(stk->current_agent); } static int duration_to_msecs(const struct stk_duration *duration) |