avdtp: Fix possible unbalance ref count
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 22 Jun 2020 16:21:27 +0000 (09:21 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:49 +0000 (14:30 +0530)
commitd5e170e939e62d3a73dcef71ca85bb473ed0d93e
tree2e2f43dd05fbb0b80ad65ad4465ff369e5dc9922
parent788aab98d65b1cecbed42eec24631babc457e8ab
avdtp: Fix possible unbalance ref count

It has been reported that under some unknown circuntances the reference
number of AVDTP sessions can go bellow 0 (loop around) causing a crash:

bluetoothd[5633]: profiles/audio/avdtp.c:avdtp_ref() 0x56a882b8a500: ref=-2101995743
bluetoothd[5633]: profiles/audio/a2dp.c:discover_cb() err (nil)
WARNING crash_reporter[10707]: [user] Received crash notification for bluetoothd[5633]

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