[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-xen master] usb: ehci: fix memory leak in ehci_init_transfer



commit 791f97758e223de3290592d169f8e6339c281714
Author:     Li Qiang <liqiang6-s@xxxxxx>
AuthorDate: Tue Nov 8 04:11:10 2016 -0800
Commit:     Stefan Hajnoczi <stefanha@xxxxxxxxxx>
CommitDate: Thu Nov 10 15:29:58 2016 +0000

    usb: ehci: fix memory leak in ehci_init_transfer
    
    In ehci_init_transfer function, if the 'cpage' is bigger than 4,
    it doesn't free the 'p->sgl' once allocated previously thus leading
    a memory leak issue. This patch avoid this.
    
    Signed-off-by: Li Qiang <liqiang6-s@xxxxxx>
    Message-id: 5821c0f4.091c6b0a.e0c92.e811@xxxxxxxxxxxxx
    Signed-off-by: Gerd Hoffmann <kraxel@xxxxxxxxxx>
---
 hw/usb/hcd-ehci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index f4ece9a..7622a3a 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1190,6 +1190,7 @@ static int ehci_init_transfer(EHCIPacket *p)
     while (bytes > 0) {
         if (cpage > 4) {
             fprintf(stderr, "cpage out of range (%d)\n", cpage);
+            qemu_sglist_destroy(&p->sgl);
             return -1;
         }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.