audio/media: Destroy transport if SetConfiguration fails
authorMarijn Suijten <marijns95@gmail.com>
Mon, 26 Oct 2020 19:54:08 +0000 (20:54 +0100)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:33 +0000 (19:08 +0530)
commitb69b807bfeb64c107a0f00cc2ce0a032dc0b61e4
tree9fcb6616b2485600c84b70c66a059d8ac80768d1
parent38c7a4e70587e1500b3882af408b5fca69ce5abd
audio/media: Destroy transport if SetConfiguration fails

set_configuration creates a transport before calling SetConfiguration on
the MediaEndpoint1 DBus interface.  If this DBus call fails the
transport sticks around while it should instead be cleaned up.

When the peer retries or reconnects (in case of BlueZ which cuts the
connection due to a missing recount [1]) set_configuration finds this
old transport and returns FALSE.  The peer will never succeed this call
unless it randomly decides to call clear_configuration or BlueZ is
restarted.

[1]: https://marc.info/?l=linux-bluetooth&m=160364326629847&w=2

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
profiles/audio/media.c