From 4cd5a2c0dc111aa55f08b2585fcdaeabe48e6cf3 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 25 Nov 2008 16:55:02 -0300 Subject: Fix bug which invalidates a device pointer before unlocking. --- audio/unix.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'audio/unix.c') diff --git a/audio/unix.c b/audio/unix.c index ea5e3b8a..a82d10ff 100644 --- a/audio/unix.c +++ b/audio/unix.c @@ -244,7 +244,6 @@ static void headset_discovery_complete(struct audio_device *dev, void *user_data failed: error("discovery failed"); unix_ipc_error(client, BT_SETCONFIGURATION_RSP, EIO); - client->dev = NULL; } static void headset_setup_complete(struct audio_device *dev, void *user_data) @@ -280,7 +279,6 @@ static void headset_setup_complete(struct audio_device *dev, void *user_data) failed: error("config failed"); unix_ipc_error(client, BT_SETCONFIGURATION_RSP, EIO); - client->dev = NULL; } static void headset_resume_complete(struct audio_device *dev, void *user_data) @@ -289,6 +287,7 @@ static void headset_resume_complete(struct audio_device *dev, void *user_data) char buf[BT_AUDIO_IPC_PACKET_SIZE]; struct bt_streamstart_rsp *rsp = (void *) buf; struct bt_streamfd_ind *ind = (void *) buf; + struct headset_data *hs = &client->d.hs; client->req_id = 0; @@ -309,6 +308,7 @@ static void headset_resume_complete(struct audio_device *dev, void *user_data) if (unix_sendmsg_fd(client->sock, client->data_fd) < 0) { error("unix_sendmsg_fd: %s(%d)", strerror(errno), errno); + headset_unlock(client->dev, hs->lock); goto failed; } @@ -317,7 +317,6 @@ static void headset_resume_complete(struct audio_device *dev, void *user_data) failed: error("resume failed"); unix_ipc_error(client, BT_STREAMSTART_RSP, EIO); - client->dev = NULL; } static void headset_suspend_complete(struct audio_device *dev, void *user_data) -- cgit