summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2016-08-23 20:34:52 -0500
committerDenis Kenzior <denkenz@gmail.com>2016-08-23 20:34:52 -0500
commit80a71f32cd2fd0f780cf4b76a54140aa4e1084c4 (patch)
tree0be5ccf1c60c18e10460140d021932b8c8ad6ae4
parent54c9068ff2f9e3469e67a8cb862c247cb5d70221 (diff)
downloadofono-80a71f32cd2fd0f780cf4b76a54140aa4e1084c4.tar.gz
handsfree-audio: Fix crash
For HFP 1.5 devices the driver is always set to NULL. So if the AG establishes the SCO connection first, we might crash.
-rw-r--r--src/handsfree-audio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
index 8db99e19..dab16da2 100644
--- a/src/handsfree-audio.c
+++ b/src/handsfree-audio.c
@@ -203,7 +203,7 @@ static gboolean sco_accept(GIOChannel *io, GIOCondition cond,
send_new_connection(card->path, nsk, card->selected_codec);
close(nsk);
- if (card->driver->sco_connected_hint)
+ if (card->driver && card->driver->sco_connected_hint)
card->driver->sco_connected_hint(card);
return TRUE;