diff options
| author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-11-25 16:55:02 -0300 | 
|---|---|---|
| committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-11-25 16:55:02 -0300 | 
| commit | 4cd5a2c0dc111aa55f08b2585fcdaeabe48e6cf3 (patch) | |
| tree | abf7f1ca92167b5de253108e9454722fa2b77f2e | |
| parent | c6ca785eb241e6e93bcc6ef1ef430cf09ae362b3 (diff) | |
Fix bug which invalidates a device pointer before unlocking.
| -rw-r--r-- | audio/unix.c | 5 | 
1 files changed, 2 insertions, 3 deletions
| 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) | 
