]> www.infradead.org Git - users/jedix/linux-maple.git/commit
vmxnet3: repair memory leak
authorNeil Horman <nhorman@tuxdriver.com>
Mon, 22 Jan 2018 21:06:37 +0000 (16:06 -0500)
committerJack Vogel <jack.vogel@oracle.com>
Thu, 22 Feb 2018 19:28:50 +0000 (11:28 -0800)
commiteb2404671bf92b747da88d89c07a4e45e277d310
tree6d55aecc401e750c794e59f8333e9c25e87b55e5
parent7e9200cbdd22183e36eea83e9d6ecd8d7f5da50b
vmxnet3: repair memory leak

with the introduction of commit
b0eb57cb97e7837ebb746404c2c58c6f536f23fa, 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>
Orabug: 27479086
(cherry picked from commit 848b159835ddef99cc4193083f7e786c3992f580)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
drivers/net/vmxnet3/vmxnet3_drv.c