All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] stk: Fix crash seen in stk_alpha_id_unset
@ 2011-07-15 16:29 Jeevaka Badrappan
  2011-07-15 16:35 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Jeevaka Badrappan @ 2011-07-15 16:29 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 846 bytes --]

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.
---
 src/stk.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/stk.c b/src/stk.c
index 4df23b5..e8ffb42 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -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)
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-15 16:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-15 16:29 [PATCH] stk: Fix crash seen in stk_alpha_id_unset Jeevaka Badrappan
2011-07-15 16:35 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.