Parent: ec2a1f21424e2adaf5e45a0cb403a79f4987555c
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Committer: Johan Hedberg <johan.hedberg@intel.com>
Date: 2012-10-16 10:38:33
Tree: 02d72f96b51417aebedc48e2f01232e96bfe6484
AVRCP: Fix crash on disconnect In case of multiple session being active the code was registering one PDU hanlder per AVRCP session and given the session pointer as user data causing the following: 24 bytes in 1 blocks are definitely lost in loss record 370 of 893 at 0x4A0884D: malloc (vg_replace_malloc.c:263) by 0x4C803FE: g_malloc (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x12EE9D: avctp_register_browsing_pdu_handler (avctp.c:1259) by 0x12FD7B: state_changed (avrcp.c:1402) by 0x12D391: avctp_set_state (avctp.c:403) by 0x12E6B4: avctp_confirm_cb (avctp.c:871) by 0x1606A3: server_cb (btio.c:254) by 0x4C7A824: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x4C7AB57: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x4C7AF51: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.4) by 0x120EA1: main (main.c:551) To fix this the PDU handlers are now per AVCTP session/channel so each AVRCP session can register its own handler and pass itself as user data.
Diffstat
| M | audio/avctp.c | | | 180 | ++++++++++++++++++++++++++++++++++++++++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| M | audio/avctp.h | | | 10 | ++++++- - - - |
| M | audio/avrcp.c | | | 56 | ++++++++++++++++++++++++++++++- - - - - - - - - - - - - - - - - - - - - - - - - - |
| M | audio/avrcp.h | | | 1 | + |
4 files changed, 148 insertions(+), 99 deletions(-)