From d58c13fb25e3ca93dcda915460600bdee6740751 Mon Sep 17 00:00:00 2001 From: Dmitry Grinberg Date: Sat, 10 Oct 2015 10:10:11 +0000 Subject: Avoid an annoying bug that only hits BCM chips running at less than 3MBps Change-Id: If31e05cd4789660780b4f34288c0d4023554afe6 --- Android.mk | 4 ++++ src/hardware.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/Android.mk b/Android.mk index 405a292..6cab564 100644 --- a/Android.mk +++ b/Android.mk @@ -31,6 +31,10 @@ ifeq ($(BOARD_HAVE_SAMSUNG_BLUETOOTH),true) LOCAL_CFLAGS += -DSAMSUNG_BLUETOOTH endif +ifeq ($(BCM_BLUETOOTH_MANTA_BUG), true) + LOCAL_CFLAGS += -DMANTA_BUG +endif + include $(LOCAL_PATH)/vnd_buildcfg.mk include $(BUILD_SHARED_LIBRARY) diff --git a/src/hardware.c b/src/hardware.c index 651e666..8ea1c61 100755 --- a/src/hardware.c +++ b/src/hardware.c @@ -1045,8 +1045,15 @@ void hw_config_cback(void *p_mem) } // if (p_buf != NULL) /* Free the RX event buffer */ + +// On manta this causes a crash due to an overrun elsewhere. +// Sad as it is, if we just do not do the free here we'll just leak less than 4K each time BT is turned on. +// And since when it is turned off, the process dies, this realy only costs us 4K total. +// I'm willing to part with 4K to avoid debugging bluedroid +#ifndef MANTA_BUG if (bt_vendor_cbacks) bt_vendor_cbacks->dealloc(p_evt_buf); +#endif if (is_proceeding == FALSE) { -- cgit v1.2.3