summaryrefslogtreecommitdiff
path: root/dhd_debug.c
diff options
context:
space:
mode:
authorDamon Kim <taekhun.kim@broadcom.corp-partner.google.com>2021-11-19 14:51:16 +0900
committerTreeHugger Robot <treehugger-gerrit@google.com>2021-11-22 09:57:01 +0000
commit97cb610759ec5151ec2db5457cef84d550fbec6c (patch)
treeb2b70fc585ac8737debea7b8839a7c768fd44dbd /dhd_debug.c
parentc685f45b9dba0d50a83f3f20f1f30ab494a33c8b (diff)
downloadbcm4389-97cb610759ec5151ec2db5457cef84d550fbec6c.tar.gz
bcmdhd: Fixed to use vmalloc instead of kmalloc for debug module (additional fix)
Recently, the related fix(pa/2089102) were merged into GG repo as well as BRCM repo. However, during the internal testing, some issues happened by the previous change. So, this is required fix and should be synced up properly. (For example, alloced by VMALLOC, but freed by MFREE. This should be fixed.) Bug: 205228870, 205683907 Test: No issue is seen in basic sanity test Change-Id: Id931a760ec309262764a5a0930b3d5ae7038ce20 Merged-In: Id931a760ec309262764a5a0930b3d5ae7038ce20 Signed-off-by: Roger Wang <wangroger@google.com> (cherry picked from commit 50ac5455fd43485c5e5f63035c15fe7100509744)
Diffstat (limited to 'dhd_debug.c')
-rw-r--r--dhd_debug.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/dhd_debug.c b/dhd_debug.c
index 8c802fe..5db892b 100644
--- a/dhd_debug.c
+++ b/dhd_debug.c
@@ -3180,9 +3180,7 @@ error:
}
}
- if (dbg) {
- VMFREE(dhdp->osh, dbg, sizeof(dhd_dbg_t));
- }
+ VMFREE(dhdp->osh, dbg, sizeof(dhd_dbg_t));
return ret;
#endif /* DHD_DEBUGABILITY_LOG_DUMP_RING || BTLOG ||
@@ -3197,14 +3195,23 @@ error:
void
dhd_dbg_detach(dhd_pub_t *dhdp)
{
- int ring_id;
dhd_dbg_t *dbg;
+#if defined(DHD_DEBUGABILITY_LOG_DUMP_RING) || defined(BTLOG) || \
+ defined(DHD_DEBUGABILITY_EVENT_RING) || defined(DHD_PKT_LOGGING_DBGRING)
+ int ring_id;
dhd_dbg_ring_t *ring = NULL;
+#endif /* DHD_DEBUGABILITY_LOG_DUMP_RING || BTLOG ||
+ * DHD_DEBUGABILITY_EVENT_RING || DHD_PKT_LOGGING_DBGRING ||
+ * (DEBUGABILITY && CUSTOMER_HW6)
+ */
- if (!dhdp->dbg)
+ dbg = dhdp->dbg;
+ if (!dbg) {
return;
+ }
- dbg = dhdp->dbg;
+#if defined(DHD_DEBUGABILITY_LOG_DUMP_RING) || defined(BTLOG) || \
+ defined(DHD_DEBUGABILITY_EVENT_RING) || defined(DHD_PKT_LOGGING_DBGRING)
for (ring_id = DEBUG_RING_ID_INVALID + 1; ring_id < DEBUG_RING_ID_MAX; ring_id++) {
if (VALID_RING(dbg->dbg_rings[ring_id].id)) {
ring = &dbg->dbg_rings[ring_id];
@@ -3220,15 +3227,19 @@ dhd_dbg_detach(dhd_pub_t *dhdp)
if (ring_id != PACKET_LOG_RING_ID)
#endif /* DHD_PKT_LOGGING_DBGRING */
{
- MFREE(dhdp->osh, ring->ring_buf, ring->ring_size);
+ VMFREE(dhdp->osh, ring->ring_buf, ring->ring_size);
}
ring->ring_buf = NULL;
}
ring->ring_size = 0;
}
}
- MFREE(dhdp->osh, dhdp->dbg, sizeof(dhd_dbg_t));
+ VMFREE(dhdp->osh, dhdp->dbg, sizeof(dhd_dbg_t));
+#endif /* DHD_DEBUGABILITY_LOG_DUMP_RING || BTLOG ||
+ * DHD_DEBUGABILITY_EVENT_RING || DHD_PKT_LOGGING_DBGRING ||
+ * (DEBUGABILITY && CUSTOMER_HW6)
+ */
#ifdef DHD_DEBUGABILITY_LOG_DUMP_RING
g_ring_buf.dhd_pub = NULL;
#endif /* DHD_DEBUGABILITY_LOG_DUMP_RING */