|SUCCESS| [v2] net/bnxt/tf_core: fix TPM pool create error return
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Tue Oct 20 10:52:46 CEST 2026
Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/171730
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-10-20
# Review of DPDK Patch: net/bnxt/tf_core: fix TPM pool create error return
## ERRORS
None identified.
## WARNINGS
None identified.
## INFO
**1. Error handling pattern is sound**
The patch correctly identifies and fixes two distinct error handling bugs:
1. Missing `-ENOMEM` return when `rte_zmalloc()` fails (line 618-620):
The original code would fall through to cleanup with `rc = 0` from the previous successful operation.
The fix correctly sets `rc = -ENOMEM` before jumping to cleanup.
2. Error code preservation across cleanup (line 643-644, 674):
The original cleanup loop overwrote `rc` with return values from `cfa_tim_tpm_inst_get()` and `cfa_tim_tpm_inst_set()`,
losing the original error that triggered cleanup.
The fix preserves the triggering error in `err` and returns that instead.
Both patterns are correct and follow DPDK error handling conventions.
**2. Cleanup path verification**
The cleanup code properly:
- Iterates over all regions and directions that may have been partially initialized
- Calls `cfa_tim_tpm_inst_get()` to retrieve TPM instances before freeing
- Calls `cfa_tpm_close()` on non-NULL TPM instances
- Frees allocated memory with `rte_free()`
- Calls `cfa_tim_tpm_inst_set()` to clear the instance storage
- Returns the preserved error code
No resource leaks identified in the cleanup path.
**3. Minor style observation**
The comment "Keep the error that got us here; the calls below overwrite rc" (line 643)
clearly explains the intent of the `err` variable. This is good practice.
Review-Result: CLEAN
More information about the test-report
mailing list