|WARNING| net/bnxt: fix flow db lock-free issue during shutdown
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Mon Oct 5 19:45:55 CEST 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/170563
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-10-05
# DPDK Patch Review
## Summary
The patch fixes a lock-use-after-destroy bug in the bnxt driver shutdown path by reordering `ulp_tfc_tbl_scope_deinit()` to execute before `pthread_mutex_destroy()`.
---
## Errors
### 1. Use-after-free / Lock-use-after-destroy
**Original code:**
```c
pthread_mutex_destroy(&bp->ulp_ctx->cfg_data->flow_db_lock);
ulp_tfc_tbl_scope_deinit(bp);
```
**Problem:** `ulp_tfc_tbl_scope_deinit()` likely accesses `flow_db_lock` during table scope cleanup. Calling it after `pthread_mutex_destroy()` results in undefined behavior - the function would attempt to lock/unlock a destroyed mutex.
**Fix:** The patch correctly reorders the calls:
```c
ulp_tfc_tbl_scope_deinit(bp);
pthread_mutex_destroy(&bp->ulp_ctx->cfg_data->flow_db_lock);
```
This is the correct fix for the bug described.
---
## Warnings
None.
---
## Info
None.
---
## Conclusion
The patch is **correct** and properly addresses a real correctness bug. The fix follows the standard pattern for resource cleanup: use resources first, then destroy synchronization primitives. The patch makes no other changes and is appropriately scoped to the single bug being fixed.
More information about the test-report
mailing list