diff options
Diffstat (limited to 'audio/pcm_bluetooth.c')
| -rw-r--r-- | audio/pcm_bluetooth.c | 9 | 
1 files changed, 5 insertions, 4 deletions
| diff --git a/audio/pcm_bluetooth.c b/audio/pcm_bluetooth.c index 6338bc25..dd61089f 100644 --- a/audio/pcm_bluetooth.c +++ b/audio/pcm_bluetooth.c @@ -1211,15 +1211,15 @@ done:  			return ret;  	} +	ret = bluetooth_recvmsg_fd(data); +	if (ret < 0) +		return ret; +  	if (data->stream.fd == -1) {  		SNDERR("Error while configuring device: could not acquire audio socket");  		return -EINVAL;  	} -	ret = bluetooth_recvmsg_fd(data); -	if (ret < 0) -		return ret; -  	/* It is possible there is some outstanding  	data in the pipe - we have to empty it */  	while (recv(data->stream.fd, data->buffer, data->cfg.pkt_len, @@ -1244,6 +1244,7 @@ static int bluetooth_init(struct bluetooth_data *data, snd_pcm_stream_t stream,  	memset(data, 0, sizeof(struct bluetooth_data));  	data->server.fd = -1; +	data->stream.fd = -1;  	sk = socket(PF_LOCAL, SOCK_STREAM, 0);  	if (sk < 0) { | 
