bluetooth: Check return value of start_thread()

The function can return an error, so in that case the profile change
should fail.
This commit is contained in:
Mikel Astiz 2012-10-19 10:11:23 +02:00 committed by Tanu Kaskinen
parent fcfc0e536a
commit e68712acb4

View file

@ -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;