Commit c6caae55 authored by Fam Zheng's avatar Fam Zheng Committed by Paolo Bonzini
Browse files

scsi-generic: Simplify error handling code



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

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

Signed-off-by: default avatarFam Zheng <famz@redhat.com>
Message-Id: <20180118025245.13042-1-famz@redhat.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 0b152095
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -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,
    if (!blkconf_apply_backend_options(&s->conf,
                                       blk_is_read_only(s->conf.blk),
                                  true, &local_err);
    if (local_err) {
        error_propagate(errp, local_err);
                                       true, errp)) {
        return;
    }