summaryrefslogtreecommitdiffstats
path: root/audio/headset.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/headset.c')
-rw-r--r--audio/headset.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/audio/headset.c b/audio/headset.c
index b58aa903..5fc33c43 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -447,7 +447,7 @@ failed:
static gboolean rfcomm_connect_cb(GIOChannel *chan, GIOCondition cond,
audio_device_t *device)
{
- struct headset *hs = device->headset;
+ struct headset *hs;
char hs_address[18];
int sk, ret, err;
socklen_t len;
@@ -455,6 +455,8 @@ static gboolean rfcomm_connect_cb(GIOChannel *chan, GIOCondition cond,
if (cond & G_IO_NVAL)
return FALSE;
+ hs = device->headset;
+
assert(hs != NULL);
assert(hs->pending_connect != NULL);
assert(hs->rfcomm == NULL);