mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
iscsi: Don't use error_is_set() to suppress additional errors
Using error_is_set(errp) that way can sweep programming errors under the carpet when we get called incorrectly with an error set. Commit24d3bd6
added a broken error path to iscsi_do_inquiry(): it first calls error_setg(), then jumps to the preexisting error label, where error_setg() gets called again, triggering an assertion failure. Commitcbee81f
fixed this by guarding the second error_setg() with an error_is_set(). Replace this fix by a simpler and safer one: jump right behind the second error_setg(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
f70edf9948
commit
172fc4dd33
1 changed files with 4 additions and 5 deletions
|
@ -1095,16 +1095,15 @@ static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun,
|
||||||
*inq = scsi_datain_unmarshall(task);
|
*inq = scsi_datain_unmarshall(task);
|
||||||
if (*inq == NULL) {
|
if (*inq == NULL) {
|
||||||
error_setg(errp, "iSCSI: failed to unmarshall inquiry datain blob");
|
error_setg(errp, "iSCSI: failed to unmarshall inquiry datain blob");
|
||||||
goto fail;
|
goto fail_with_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
return task;
|
return task;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
if (!error_is_set(errp)) {
|
|
||||||
error_setg(errp, "iSCSI: Inquiry command failed : %s",
|
error_setg(errp, "iSCSI: Inquiry command failed : %s",
|
||||||
iscsi_get_error(iscsi));
|
iscsi_get_error(iscsi));
|
||||||
}
|
fail_with_err:
|
||||||
if (task != NULL) {
|
if (task != NULL) {
|
||||||
scsi_free_scsi_task(task);
|
scsi_free_scsi_task(task);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue