Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit 8cd5d01

Browse files
committed
Set free'd pointers in flexport init code to NULL
This is a bandaid for the double free errors, but does not fix the underlying issue.
1 parent ee30895 commit 8cd5d01

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/bcmtm/flexport/tomahawk/src/tomahawk_flexport_top.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ soc_tomahawk_flex_end (
366366
LOG_DEBUG(BSL_LS_SOC_PORT,
367367
(BSL_META_U(unit, "Size of cookie = %d Bytes.\n"), sz));
368368
sal_free(port_schedule_state->cookie);
369+
port_schedule_state->cookie = NULL;
369370
LOG_DEBUG(BSL_LS_SOC_PORT,
370371
(BSL_META_U(unit, "Cookie space deallocated.\n")));
371372

@@ -375,6 +376,7 @@ soc_tomahawk_flex_end (
375376
for (j = 0; j < port_schedule_state->resource[i].num_lanes; j++) {
376377
if (port_schedule_state->resource[i].lane_info[j] != NULL) {
377378
sal_free(port_schedule_state->resource[i].lane_info[j]);
379+
port_schedule_state->resource[i].lane_info[j] = NULL;
378380
LOG_DEBUG(BSL_LS_SOC_PORT, (BSL_META_U(unit,
379381
"Lane information space deallocated.\n")));
380382
}

0 commit comments

Comments
 (0)