|
| 1 | +From 019c42a5e63601ff10b3d5ca328eb3d292fa0472 Mon Sep 17 00:00:00 2001 |
| 2 | + |
| 3 | +Date: Tue, 25 Jul 2023 07:49:48 +0530 |
| 4 | +Subject: [PATCH] clang fix for A12 libwifihal |
| 5 | + |
| 6 | +Tracked-On: OAM-111118 |
| 7 | +Signed-off-by: vdanix < [email protected]> |
| 8 | + |
| 9 | +diff --git a/lib/driver_if.cpp b/lib/driver_if.cpp |
| 10 | +index 5d6baed..e76e78b 100644 |
| 11 | +--- a/lib/driver_if.cpp |
| 12 | ++++ b/lib/driver_if.cpp |
| 13 | +@@ -34,10 +34,6 @@ |
| 14 | + #include <linux/nl80211.h> |
| 15 | + #include "hal_debug.h" |
| 16 | + |
| 17 | +-#ifdef __clang_analyzer__ |
| 18 | +-#define free |
| 19 | +-#endif |
| 20 | +- |
| 21 | + /* libnl 1.x compatibility code */ |
| 22 | + #if !defined(CONFIG_LIBNL20) && !defined(CONFIG_LIBNL30) |
| 23 | + |
| 24 | +@@ -1168,14 +1164,13 @@ static int station_dump_handler(struct nl_msg *msg, void *arg) |
| 25 | + hal_printf(MSG_ERROR, "%s: Failed to allocate memory", __func__); |
| 26 | + return NL_SKIP; |
| 27 | + } |
| 28 | +- assert(s); |
| 29 | + if (station_dump(msg, tb, s)) { |
| 30 | + free(s); |
| 31 | + return NL_SKIP; |
| 32 | + } |
| 33 | + |
| 34 | + dl_list_add_tail(sta_list, &s->list); |
| 35 | +- |
| 36 | ++ free(s); |
| 37 | + return NL_SKIP; |
| 38 | + } |
| 39 | + |
| 40 | +@@ -1387,6 +1382,7 @@ static int survey_handler(struct nl_msg *msg, void *arg) |
| 41 | + |
| 42 | + dl_list_add_tail(survey_list, &survey->list); |
| 43 | + |
| 44 | ++ free(survey); |
| 45 | + return NL_SKIP; |
| 46 | + } |
| 47 | + |
| 48 | +@@ -1573,7 +1569,6 @@ void *driver_if_init(void *handle, drv_event_cb event_cb, u32 ifidx) |
| 49 | + |
| 50 | + hal_printf(MSG_DEBUG, "%s: ifidx=%u", __func__, ifidx); |
| 51 | + |
| 52 | +- assert(drv); |
| 53 | + drv->nl_cb = nl_cb_alloc(NL_CB_DEFAULT); |
| 54 | + if (!drv->nl_cb) { |
| 55 | + hal_printf(MSG_ERROR, "Failed to allocate netlink callback!"); |
| 56 | +-- |
| 57 | +2.41.0 |
| 58 | + |
0 commit comments