|SUCCESS| [v2] net/netvsc: fix event buffer leak on realloc failure

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Sat Oct 31 10:32:41 CET 2026


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

_AI Code Review_

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

# DPDK Patch Review

## ERRORS

None identified.

## WARNINGS

None identified.

## INFO

**1. Resource leak on early break when event_buf allocation fails (pre-existing)**

File: `drivers/net/netvsc/hn_rxtx.c`
Line: Not changed by patch (pre-existing issue)

The code uses `break` to exit the event processing loop when reallocation fails:
```c
if (new_buf == NULL)
    break;	/* out of memory, no more events now */
```

However, this is inside what appears to be an event processing loop. If the loop has allocated resources prior to this point that need cleanup on early exit, those resources would leak. The patch does not introduce this issue -- it preserves the existing `break` behavior. This should be verified by examining the full function context to ensure no cleanup is needed.

**2. Patch correctly fixes the resource leak**

The original code had:
```c
rxq->event_buf = rte_realloc(rxq->event_buf, rxq->event_sz,
                             RTE_CACHE_LINE_SIZE);
if (rxq->event_buf)
    goto retry;
/* out of memory, no more events now */
rxq->event_sz = 0;
break;
```

This overwrites `rxq->event_buf` before checking success, causing the old buffer to leak on failure.

The patch correctly fixes this by:
1. Using a temporary `new_buf` pointer
2. Only updating `rxq->event_buf` and `rxq->event_sz` on success
3. Preserving the existing buffer on failure

**3. Style: explicit NULL comparison is correct**

The patch uses `if (new_buf == NULL)` which complies with DPDK's explicit comparison requirement for pointers.

**4. .mailmap update is appropriate**

The addition of the author's entry in `.mailmap` is standard practice and correct.

Review-Result: CLEAN


More information about the test-report mailing list