summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikel Astiz <mikel.astiz@bmw-carit.de>2012-10-19 10:11:23 +0200
committerTanu Kaskinen <tanuk@iki.fi>2012-10-19 18:22:51 +0300
commite68712acb41c6bd1b5af88829253c7253129417a (patch)
treec3e33810651700352c7ec7887be6fa834d3d47fb
parentfcfc0e536ae7a5a2a2a8d53c164409db5f2187f7 (diff)
downloadpulseaudio-e68712acb41c6bd1b5af88829253c7253129417a.tar.gz
bluetooth: Check return value of start_thread()
The function can return an error, so in that case the profile change should fail.
-rw-r--r--src/modules/bluetooth/module-bluetooth-device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 33d42fe1c..4b98108ae 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -2142,7 +2142,6 @@ static int start_thread(struct userdata *u) {
if (!(u->thread = pa_thread_new("bluetooth", thread_func, u))) {
pa_log_error("Failed to create IO thread");
- stop_thread(u);
return -1;
}
@@ -2233,7 +2232,8 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
goto off;
if (u->sink || u->source)
- start_thread(u);
+ if (start_thread(u) < 0)
+ goto off;
return 0;