OSDN Git Service

usb/dev-storage: Avoid qerror_report_err() outside QMP handlers
authorMarkus Armbruster <armbru@redhat.com>
Thu, 12 Mar 2015 16:26:50 +0000 (17:26 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 17 Mar 2015 13:23:53 +0000 (14:23 +0100)
qerror_report_err() is a transitional interface to help with
converting existing monitor commands to QMP.  It should not be used
elsewhere.

usb_msd_password_cb() is only called from within an HMP command
handler.  Replace by error_report_err().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/dev-storage.c

index f50bcb8..ae8d40d 100644 (file)
@@ -559,8 +559,7 @@ static void usb_msd_password_cb(void *opaque, int err)
     }
 
     if (local_err) {
-        qerror_report_err(local_err);
-        error_free(local_err);
+        error_report_err(local_err);
         qdev_unplug(&s->dev.qdev, NULL);
     }
 }