lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  6 Jan 2022 16:31:23 +0800
From:   Xianting Tian <xianting.tian@...ux.alibaba.com>
To:     mst@...hat.com, jasowang@...hat.com
Cc:     virtualization@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org,
        Xianting Tian <xianting.tian@...ux.alibaba.com>
Subject: [PATCH] virtio-pci: fix memory leak of vp_dev

In virtio_pci_probe(), vp_dev will not be freed if it goes to
"err_register" branch. fix it

Signed-off-by: Xianting Tian <xianting.tian@...ux.alibaba.com>
---
 drivers/virtio/virtio_pci_common.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
index fdbde1db5..48b5ac15e 100644
--- a/drivers/virtio/virtio_pci_common.c
+++ b/drivers/virtio/virtio_pci_common.c
@@ -602,8 +602,7 @@ static int virtio_pci_probe(struct pci_dev *pci_dev,
 err_enable_device:
 	if (reg_dev)
 		put_device(&vp_dev->vdev.dev);
-	else
-		kfree(vp_dev);
+	kfree(vp_dev);
 	return rc;
 }
 
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ