]> git.baikalelectronics.ru Git - kernel.git/commit
vmxnet3: repair memory leak
authorNeil Horman <nhorman@tuxdriver.com>
Mon, 22 Jan 2018 21:06:37 +0000 (16:06 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Jan 2018 00:57:52 +0000 (19:57 -0500)
commit63ea7cd5f23dbee6c2759d5e91e73c604ed8d982
tree39934c28edd1e4a115b2c74a98c13335281a2963
parent5cd3a9ab261a6a8335d63ec7101c43aab5f6284f
vmxnet3: repair memory leak

with the introduction of commit
c3e78f533b24ca113fd00da5e38bb43658aea9f0, 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
frequently.

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

Tested by myself with successful results

Applies to net, and should likely be queued for stable, please

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reported-By: boyang@redhat.com
CC: boyang@redhat.com
CC: Shrikrishna Khare <skhare@vmware.com>
CC: "VMware, Inc." <pv-drivers@vmware.com>
CC: David S. Miller <davem@davemloft.net>
Acked-by: Shrikrishna Khare <skhare@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vmxnet3/vmxnet3_drv.c