mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-02 18:10:57 +02:00
fix(bt/btc): Fix array compared against 0 in btc_manage.c
This commit is contained in:
@@ -8,16 +8,17 @@
|
||||
#include "btc/btc_task.h"
|
||||
#include "osi/thread.h"
|
||||
|
||||
#if BTC_DYNAMIC_MEMORY == FALSE
|
||||
void *btc_profile_cb_tab[BTC_PID_NUM] = {};
|
||||
#else
|
||||
#if BTC_DYNAMIC_MEMORY == TRUE
|
||||
void **btc_profile_cb_tab;
|
||||
#else
|
||||
void *btc_profile_cb_tab[BTC_PID_NUM] = {};
|
||||
#endif
|
||||
|
||||
void esp_profile_cb_reset(void)
|
||||
{
|
||||
#if BTC_DYNAMIC_MEMORY == TRUE
|
||||
if (btc_profile_cb_tab == NULL) {
|
||||
void *p = btc_profile_cb_tab;
|
||||
if (p == NULL) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -32,7 +33,8 @@ void esp_profile_cb_reset(void)
|
||||
int btc_profile_cb_set(btc_pid_t profile_id, void *cb)
|
||||
{
|
||||
#if BTC_DYNAMIC_MEMORY == TRUE
|
||||
if (btc_profile_cb_tab == NULL) {
|
||||
void *p = btc_profile_cb_tab;
|
||||
if (p == NULL) {
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
@@ -49,7 +51,8 @@ int btc_profile_cb_set(btc_pid_t profile_id, void *cb)
|
||||
void *btc_profile_cb_get(btc_pid_t profile_id)
|
||||
{
|
||||
#if BTC_DYNAMIC_MEMORY == TRUE
|
||||
if (btc_profile_cb_tab == NULL) {
|
||||
void *p = btc_profile_cb_tab;
|
||||
if (p == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user