Skip to content

Commit

Permalink
iscsi: Don't set error if already set in iscsi_do_inquiry
Browse files Browse the repository at this point in the history
This eliminates the possible assertion failure in error_setg().

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
Fam Zheng authored and kevmw committed Apr 4, 2014
1 parent 5913815 commit cbee81f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions block/iscsi.c
Expand Up @@ -1101,8 +1101,10 @@ static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun,
return task;

fail:
error_setg(errp, "iSCSI: Inquiry command failed : %s",
iscsi_get_error(iscsi));
if (!error_is_set(errp)) {
error_setg(errp, "iSCSI: Inquiry command failed : %s",
iscsi_get_error(iscsi));
}
if (task != NULL) {
scsi_free_scsi_task(task);
}
Expand Down

0 comments on commit cbee81f

Please sign in to comment.