Commit 848b1598 authored by Neil Horman's avatar Neil Horman Committed by David S. Miller
Browse files

vmxnet3: repair memory leak

with the introduction of commit

, it appears that rq->buf_info
is improperly handled.  While it is heap allocated when an rx queue is
setup, and freed when torn down, an old line of code in
vmxnet3_rq_destroy was not properly removed, leading to rq->buf_info[0]
being set to NULL prior to its being freed, causing a memory leak, which
eventually exhausts the system on repeated create/destroy operations
(for example, when  the mtu of a vmxnet3 interface is changed

Fix is pretty straight forward, just move the NULL set to after the

Tested by myself with successful results

Applies to net, and should likely be queued for stable, please
Signed-off-by: default avatarNeil Horman <>
CC: Shrikrishna Khare <>
CC: "VMware, Inc." <>
CC: David S. Miller <>
Acked-by: default avatarShrikrishna Khare <>
Signed-off-by: default avatarDavid S. Miller <>
parent e9191ffb
......@@ -1616,7 +1616,6 @@ static void vmxnet3_rq_destroy(struct vmxnet3_rx_queue *rq,
rq->rx_ring[i].base = NULL;
rq->buf_info[i] = NULL;
if (rq->data_ring.base) {
......@@ -1638,6 +1637,7 @@ static void vmxnet3_rq_destroy(struct vmxnet3_rx_queue *rq,
(rq->rx_ring[0].size + rq->rx_ring[1].size);
dma_free_coherent(&adapter->pdev->dev, sz, rq->buf_info[0],
rq->buf_info[0] = rq->buf_info[1] = NULL;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment