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 <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2015-05-27 10:44:57 +03:00 committed by Anas Nashif
parent d80a8fc845
commit 1c65da5ed7

View file

@ -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;
}