From 5758a9e1c6af5f40318e7cc19f133462d08087d8 Mon Sep 17 00:00:00 2001 From: ZhongYao Luo Date: Tue, 3 Dec 2019 12:53:06 +0800 Subject: [PATCH] bluetooth: h5: Fix memory access error According to the context information, the processing of net_buf_add_u8 within the get_evt_buf function is redundant and incorrect. Signed-off-by: ZhongYao Luo --- drivers/bluetooth/hci/h5.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/bluetooth/hci/h5.c b/drivers/bluetooth/hci/h5.c index 3a6b7b0c767..a38ccc5b2b2 100644 --- a/drivers/bluetooth/hci/h5.c +++ b/drivers/bluetooth/hci/h5.c @@ -406,14 +406,7 @@ static void h5_process_complete_packet(u8_t *hdr) static inline struct net_buf *get_evt_buf(u8_t evt) { - struct net_buf *buf; - - buf = bt_buf_get_evt(evt, false, K_NO_WAIT); - if (buf) { - net_buf_add_u8(h5.rx_buf, evt); - } - - return buf; + return bt_buf_get_evt(evt, false, K_NO_WAIT); } static void bt_uart_isr(struct device *unused)