diff options
| author | Johan Hedberg <johan.hedberg@nokia.com> | 2009-02-01 17:35:13 -0800 | 
|---|---|---|
| committer | Johan Hedberg <johan.hedberg@nokia.com> | 2009-02-01 17:35:13 -0800 | 
| commit | cec39b3da3bab506fb63c4d312f0999ecf3530de (patch) | |
| tree | b2f4ed6a1c345a116e58d1e6a2e9ad32b1dc6e69 /audio/unix.c | |
| parent | 40ebdad50ff3e6dbe46e0ad441e3db417aa5e13c (diff) | |
Don't try to send an invalid SCO fd over the unix socket
Diffstat (limited to 'audio/unix.c')
| -rw-r--r-- | audio/unix.c | 9 | 
1 files changed, 7 insertions, 2 deletions
diff --git a/audio/unix.c b/audio/unix.c index ad311811..e30a2257 100644 --- a/audio/unix.c +++ b/audio/unix.c @@ -314,6 +314,13 @@ static void headset_resume_complete(struct audio_device *dev, void *user_data)  		goto failed;  	} +	client->data_fd = headset_get_sco_fd(dev); +	if (client->data_fd < 0) { +		error("Unable to get a SCO fd"); +		headset_unlock(client->dev, hs->lock); +		goto failed; +	} +  	memset(buf, 0, sizeof(buf));  	rsp->h.type = BT_RESPONSE;  	rsp->h.name = BT_START_STREAM; @@ -328,8 +335,6 @@ static void headset_resume_complete(struct audio_device *dev, void *user_data)  	unix_ipc_sendmsg(client, &ind->h); -	client->data_fd = headset_get_sco_fd(dev); -  	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);  | 
