Commit: e9c1c41ac195c885341f7a2e4968a8c62e2ce91a
Parent: 36e398391b6de47cce7a72bece2da182c7c4c52e
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2015-01-23 11:50:26
Tree: c34b3b645706281294fb119fb17f1c6e7be5ea16

core/device: Fix crash on remove This fixes the following backtrace which was reproduced by removing a device while being connected: Invalid write of size 4 at 0x49AF74: attio_cleanup (device.c:517) by 0x49CB65: att_disconnected_cb (device.c:3811) by 0x4C7485: disconn_handler (att.c:511) by 0x4C415F: queue_foreach (queue.c:251) by 0x4C9379: disconnect_cb (att.c:540) by 0x4D090A: watch_callback (io-glib.c:170) by 0x4E7A2A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x4E7A627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x4E7AA39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x40BC10: main (main.c:631) Address 0x70db6e8 is 472 bytes inside a block of size 592 free'd at 0x4C28577: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4E7FF7E: g_free (in /usr/lib64/libglib-2.0.so.0.3800.2) by 0x49C8FF: device_free (device.c:620) by 0x4BE059: remove_interface (object.c:658) by 0x4BEC21: g_dbus_unregister_interface (object.c:1382) by 0x4A4EFC: btd_device_unref (device.c:5185) by 0x474B18: channel_free (attrib-server.c:125) by 0x474BA4: channel_remove (attrib-server.c:986) by 0x47605F: attrib_channel_detach (attrib-server.c:1265) by 0x49AF73: attio_cleanup (device.c:516) by 0x49CB65: att_disconnected_cb (device.c:3811) by 0x4C7485: disconn_handler (att.c:511)

Diffstat

M src/attrib-server.c | 45 +++++++++++++++++- - - - - - - - - - - - - - - - - - - - - - - - - - - -
M src/device.c | 14 +++++++++- - - - -

2 files changed, 26 insertions(+), 33 deletions(-)

View Full Diff | Patch