qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code
@ 2018-01-18  2:52 Fam Zheng
  2018-01-18  4:34 ` Philippe Mathieu-Daudé
  2018-01-18  8:20 ` Paolo Bonzini
  0 siblings, 2 replies; 11+ messages in thread
From: Fam Zheng @ 2018-01-18  2:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Fam Zheng

Coverity doesn't like the ignored return value introduced in
9d3b155186c278 (hw/block: Fix the return type), and other callers are
converted already in ceff3e1f01.

This one was added lately in d9bcd6f7f23a and missed the train. Do it
now.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 hw/scsi/scsi-generic.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index ba70c0dc19..7414fe2d67 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -482,7 +482,6 @@ static void scsi_generic_realize(SCSIDevice *s, Error **errp)
     int rc;
     int sg_version;
     struct sg_scsi_id scsiid;
-    Error *local_err = NULL;
 
     if (!s->conf.blk) {
         error_setg(errp, "drive property not set");
@@ -516,11 +515,9 @@ static void scsi_generic_realize(SCSIDevice *s, Error **errp)
         error_setg(errp, "SG_GET_SCSI_ID ioctl failed");
         return;
     }
-    blkconf_apply_backend_options(&s->conf,
-                                  blk_is_read_only(s->conf.blk),
-                                  true, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (!blkconf_apply_backend_options(&s->conf,
+                                       blk_is_read_only(s->conf.blk),
+                                       true, errp)) {
         return;
     }
 
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-01-18 22:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-18  2:52 [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code Fam Zheng
2018-01-18  4:34 ` Philippe Mathieu-Daudé
2018-01-18  8:20 ` Paolo Bonzini
2018-01-18 11:21   ` Philippe Mathieu-Daudé
2018-01-18 12:03     ` Paolo Bonzini
2018-01-18 15:55       ` Philippe Mathieu-Daudé
2018-01-18 15:59         ` Paolo Bonzini
2018-01-18 20:34         ` Eric Blake
2018-01-18 21:38           ` Eduardo Habkost
2018-01-18 22:19             ` Paolo Bonzini
2018-01-18 22:39               ` Eduardo Habkost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).