[PATCH] net/netvsc: fix event buffer leak on realloc failure
Chen Zhao
ch3nzhao at gmail.com
Sun Oct 25 03:18:02 CET 2026
Hi,
The AI review reports a double-free and a dangling event_buf:
https://mails.dpdk.org/archives/test-report/2026-October/1069492.html
Both findings are false positives:
1. On successful reallocation, goto retry skips rte_free(old_buf).
The retry label is outside the ENOBUFS block. Each subsequent entry
into that block reinitializes old_buf from the current event_buf,
so a later allocation failure frees the current allocation, not an
address retained from a previous successful reallocation.
2. On failure, rte_realloc() returns NULL without freeing the old buffer.
That NULL return value has already been assigned to rxq->event_buf
before rte_free(old_buf) is reached. Thus event_buf is already NULL;
no additional NULL assignment is needed.
The patch preserves the existing reset-and-retry behavior while freeing
the old allocation on failure.
Thanks,
Chen
More information about the dev
mailing list