OSDN Git Service

net: vmxnet3: avoid memory leakage in activate_device
authorP J P <ppandit@redhat.com>
Tue, 15 Dec 2015 06:57:54 +0000 (12:27 +0530)
committerJason Wang <jasowang@redhat.com>
Mon, 11 Jan 2016 03:01:34 +0000 (11:01 +0800)
commitaa4a3dce1c88ed51b616806b8214b7c8428b7470
treefdec96d954bc34e9de9e236b9e88b189ed8cdd10
parentdd3c1684719161859553f45b73bb7d68967a3efe
net: vmxnet3: avoid memory leakage in activate_device

Vmxnet3 device emulator does not check if the device is active
before activating it, also it did not free the transmit & receive
buffers while deactivating the device, thus resulting in memory
leakage on the host. This patch fixes both these issues to avoid
host memory leakage.

Reported-by: Qinghao Tang <luodalongde@gmail.com>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/vmxnet3.c