bluetooth: Only remove cards belonging to the device.

Commit f89d64b98e fixed a crash
when disabling adapters. However, now if any device is removed
ofono card is removed, even if it belongs to different device.

Add a check for the device being unlinked to our callback to fix.

Signed-off-by: Juho Hämäläinen <juho.hamalainen@jolla.com>
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/624>
This commit is contained in:
Juho Hämäläinen 2021-08-20 12:55:40 +03:00 committed by PulseAudio Marge Bot
parent 3e2dacdb38
commit b1057f1a37

View file

@ -250,6 +250,9 @@ static pa_hook_result_t device_unlink_cb(pa_bluetooth_discovery *y, const pa_blu
pa_assert(d);
pa_assert(card);
if (d != card->transport->device)
return PA_HOOK_OK;
hf_audio_agent_card_removed(card->backend, card->path);
return PA_HOOK_OK;