a2dp: Always invalidate the cache if its configuration fails
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 24 Mar 2022 22:14:34 +0000 (15:14 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:53 +0000 (14:55 +0530)
When a configuration had been restored from last_used cache but it
fails invalidate it so another sep can be used.

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

index f561daa..94bde3d 100644 (file)
@@ -926,12 +926,10 @@ static void store_remote_seps(struct a2dp_channel *chan)
 static void invalidate_remote_cache(struct a2dp_setup *setup,
                                                struct avdtp_error *err)
 {
-if (err->category == AVDTP_ERRNO ||
-                       err->err.error_code != AVDTP_UNSUPPORTED_CONFIGURATION)
+       if (err->category == AVDTP_ERRNO)
                return;
 
-       /* Attempt to unregister Remote SEP if configuration
-        * fails with Unsupported Configuration and it was
+       /* Attempt to unregister Remote SEP if configuration fails and it was
         * loaded from cache.
         */
        if (setup->rsep && setup->rsep->from_cache) {