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

[qemu-xen stable-4.14] usb/dev-mtp: Fix Error double free after inotify failure



commit b3e49baa79908d7e1c35df3814435dda72d85267
Author:     Markus Armbruster <armbru@xxxxxxxxxx>
AuthorDate: Tue Jun 30 11:03:31 2020 +0200
Commit:     Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    usb/dev-mtp: Fix Error double free after inotify failure
    
    error_report_err() frees its first argument.  Freeing it again is
    wrong.  Don't.
    
    Fixes: 47287c27d0c367a89f7b2851e23a7f8b2d499dd6
    Cc: Gerd Hoffmann <kraxel@xxxxxxxxxx>
    Cc: Daniel P. Berrangé <berrange@xxxxxxxxxx>
    Cc: qemu-stable@xxxxxxxxxx
    Signed-off-by: Markus Armbruster <armbru@xxxxxxxxxx>
    Message-Id: <20200630090351.1247703-7-armbru@xxxxxxxxxx>
    Reviewed-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
    (cherry picked from commit 562a558647be6fe43e60f8bf3601e5b6122c0599)
    Signed-off-by: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
---
 hw/usb/dev-mtp.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 168428156b..15a2243101 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -634,7 +634,6 @@ static void usb_mtp_object_readdir(MTPState *s, MTPObject 
*o)
             error_reportf_err(err,
                               "usb-mtp: failed to add watch for %s: ",
                               o->path);
-            error_free(err);
         } else {
             trace_usb_mtp_file_monitor_event(s->dev.addr, o->path,
                                              "Watch Added");
@@ -1279,7 +1278,6 @@ static void usb_mtp_command(MTPState *s, MTPControl *c)
         if (err) {
             error_reportf_err(err,
                               "usb-mtp: file monitoring init failed: ");
-            error_free(err);
         } else {
             QTAILQ_INIT(&s->events);
         }
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14



 


Rackspace

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