|SUCCESS| [v2] net/bnxt/tf_core: fix buffer leaks in RM create DB

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Tue Oct 20 10:15:42 CEST 2026


Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/171729

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-10-20

# DPDK Patch Review

## ERRORS

None.

## WARNINGS

None.

## INFO

### Code Quality Observations

**Good practices in this patch:**
- Properly initializes all allocated pointer variables to NULL at declaration, enabling safe `tfp_free()` calls on unallocated pointers
- Introduces a unified error exit path (`free_bufs:`) that correctly releases all temporary buffers
- Preserves and propagates the original error code through the new exit path rather than returning a hardcoded `-EINVAL`
- Correctly identifies and fixes multiple resource leak paths:
  - Query buffer leaked on all paths (success, error, early returns)
  - Early error returns leaked partially-allocated temporary buffers
  - RM database structure leaked when element array allocation failed
- Both `Fixes:` tags are appropriate, tracing the leak sources to the commits that introduced them
- The fix consolidates cleanup logic, reducing future maintenance burden

**Minor style note (not a violation):**
The existing `fail:` label returns hardcoded `-EINVAL` rather than preserving the error code from the point of failure. This is pre-existing behavior and not introduced by this patch. The new `free_bufs:` label correctly preserves the error code via `return rc;`, which is the preferred pattern.

Review-Result: CLEAN


More information about the test-report mailing list