Use the prefix + propagate combo rather than manual prefix + freeing.

Cc: Paolo Bonzini <pbonz...@redhat.com>
Signed-off-by: Peter Crosthwaite <crosthwaite.pe...@gmail.com>
---

 hw/scsi/vhost-scsi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index 7eacca9..bd55ebc 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -219,9 +219,8 @@ static void vhost_scsi_realize(DeviceState *dev, Error 
**errp)
     if (vs->conf.vhostfd) {
         vhostfd = monitor_fd_param(cur_mon, vs->conf.vhostfd, &err);
         if (vhostfd == -1) {
-            error_setg(errp, "vhost-scsi: unable to parse vhostfd: %s",
-                       error_get_pretty(err));
-            error_free(err);
+            error_prefix(err, "vhost-scsi: unable to parse vhostfd: ");
+            error_propagate(errp, err);
             return;
         }
     } else {
-- 
1.9.1


Reply via email to