summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-02-25 18:27:58 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2009-02-25 18:27:58 +0200
commit9d326306a1ff9cb6421ce47d07d4367e8ff46418 (patch)
treeed8ed7a465ca6f1917be095ab4f261d14d0cd80f
parent98af825f45d896359f96d6a8059b79ca0727fa8e (diff)
Check for valid sk value before calling bt_audio_service_close
-rw-r--r--audio/pcm_bluetooth.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/audio/pcm_bluetooth.c b/audio/pcm_bluetooth.c
index c73756a4..c0a39be3 100644
--- a/audio/pcm_bluetooth.c
+++ b/audio/pcm_bluetooth.c
@@ -1672,7 +1672,8 @@ static int bluetooth_init(struct bluetooth_data *data, snd_pcm_stream_t stream,
return 0;
failed:
- bt_audio_service_close(sk);
+ if (sk >= 0)
+ bt_audio_service_close(sk);
return err;
}