From 1c65da5ed7ce053e83e4c7f98e705a6796931557 Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Wed, 27 May 2015 10:44:57 +0300 Subject: [PATCH] Bluetooth: Check returned buffer is not NULL Buffers returned by bt_uart_evt_recv() and bt_uart_acl_recv() may be NULL in theory. This makes code consistent by checking return value. Change-Id: Id39def39c8b1c4c6eefc7b2bf01702c54b3e565c Signed-off-by: Andrei Emeltchenko --- drivers/bluetooth/uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/uart.c b/drivers/bluetooth/uart.c index 1236b304b2..0bf07312a4 100644 --- a/drivers/bluetooth/uart.c +++ b/drivers/bluetooth/uart.c @@ -180,7 +180,7 @@ void bt_uart_isr(void *unused) return; } - if (remaining > bt_buf_tailroom(buf)) { + if (buf && remaining > bt_buf_tailroom(buf)) { BT_ERR("Not enough space in buffer\n"); goto failed; }