a2dp: Fix crash when SEP codec has not been initialized
authorFrédéric Danis <frederic.danis@collabora.com>
Wed, 30 Mar 2022 09:28:44 +0000 (11:28 +0200)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
commita1039eeece3b0a81e0cf732a885b1c5bef60341f
treef9ac7e157ae1f7d9a796e283ac0888dab24f52f5
parent9cd1c6e98bf7a25ed740873e926738e842eacdb4
a2dp: Fix crash when SEP codec has not been initialized

If SEP has not been properly discovered avdtp_get_codec may return NULL
thus causing crashes such as when running AVRCP/TG/VLH/BI-01-C after
AVRCP/TG/RCR/BV-04-C.

Prevent remote endpoint registration if its codec is not available.

Remove queue_isempty check from store_remote_seps since that prevents
cleaning up if no seps could be registered.

Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
profiles/audio/a2dp.c