From 99c0cac9424180ec983f4406ac3b3722244e31ef Mon Sep 17 00:00:00 2001 From: gengyuchao Date: Thu, 6 Aug 2020 22:30:24 +0800 Subject: [PATCH] Add assert when malloc fail, that may cause hci timeout --- components/bt/bluedroid/hci/hci_hal_h4.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/bt/bluedroid/hci/hci_hal_h4.c b/components/bt/bluedroid/hci/hci_hal_h4.c index ee738fa4f4..e910a9c139 100644 --- a/components/bt/bluedroid/hci/hci_hal_h4.c +++ b/components/bt/bluedroid/hci/hci_hal_h4.c @@ -365,6 +365,7 @@ static int host_recv_pkt_cb(uint8_t *data, uint16_t len) //pkt = (BT_HDR *)hci_hal_env.allocator->alloc(pkt_size); if (!pkt) { HCI_TRACE_ERROR("%s couldn't aquire memory for inbound data buffer.\n", __func__); + assert(pkt!=NULL); return -1; } pkt->offset = 0;