Message ID | 20220328204150.1855063-1-luiz.dentz@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [BlueZ,v2] a2dp: Fix crash when SEP codec has not been initialized | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/checkpatch | success | Checkpatch PASS |
tedd_an/gitlint | success | Gitlint PASS |
tedd_an/setupell | success | Setup ELL PASS |
tedd_an/buildprep | success | Build Prep PASS |
tedd_an/build | success | Build Configuration PASS |
tedd_an/makecheck | success | Make Check PASS |
tedd_an/makecheckvalgrind | success | Make Check PASS |
tedd_an/makedistcheck | success | Make Distcheck PASS |
tedd_an/build_extell | success | Build External ELL PASS |
tedd_an/build_extell_make | success | Build Make with External ELL PASS |
This is automated email and please do not reply to this email! Dear submitter, Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series: PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=626998 ---Test result--- Test Summary: CheckPatch PASS 1.51 seconds GitLint PASS 1.00 seconds Prep - Setup ELL PASS 44.05 seconds Build - Prep PASS 0.70 seconds Build - Configure PASS 8.53 seconds Build - Make PASS 1392.91 seconds Make Check PASS 11.91 seconds Make Check w/Valgrind PASS 443.86 seconds Make Distcheck PASS 228.07 seconds Build w/ext ELL - Configure PASS 8.66 seconds Build w/ext ELL - Make PASS 1379.37 seconds Incremental Build with patchesPASS 0.00 seconds --- Regards, Linux Bluetooth
diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c index c3ac432a7..db788cf93 100644 --- a/profiles/audio/a2dp.c +++ b/profiles/audio/a2dp.c @@ -2074,6 +2074,11 @@ static struct a2dp_remote_sep *register_remote_sep(void *data, void *user_data) if (sep) return sep; + if (avdtp_get_codec(rsep)) { + error("Unable to get remote sep codec"); + return NULL; + } + sep = new0(struct a2dp_remote_sep, 1); sep->chan = chan; sep->sep = rsep; @@ -2148,6 +2153,7 @@ static void load_remote_sep(struct a2dp_channel *chan, GKeyFile *key_file, struct avdtp_remote_sep *rsep; uint8_t lseid, rseid; char *value; + bool update = false; if (!seids) return; @@ -2206,10 +2212,19 @@ static void load_remote_sep(struct a2dp_channel *chan, GKeyFile *key_file, } sep = register_remote_sep(rsep, chan); - if (sep) - sep->from_cache = true; + if (!sep) { + avdtp_unregister_remote_sep(chan->session, rsep); + update = true; + continue; + } + + sep->from_cache = true; } + /* Update cache */ + if (update) + store_remote_seps(chan); + value = g_key_file_get_string(key_file, "Endpoints", "LastUsed", NULL); if (!value) return;
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> 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 --- profiles/audio/a2dp.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)