提交 0b25e9fa 编写于 作者: Q Quentin Lambert 提交者: Greg Kroah-Hartman

staging: rts5208/ms.c: add missing releases in mg_get_local_EKB and mg_get_ICV

mg_get_local_EKB and mg_get_ICV used to return with an error code before
releasing all resources. This patch add a jump to the appropriate label
ensuring that the resources are properly released before returning.

This issue was found with Hector.
Signed-off-by: NQuentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 541e4d2d
......@@ -4317,7 +4317,8 @@ int mg_get_local_EKB(struct scsi_cmnd *srb, struct rtsx_chip *chip)
set_sense_type(chip, lun, SENSE_TYPE_MG_KEY_FAIL_NOT_AUTHEN);
rtsx_clear_ms_error(chip);
rtsx_trace(chip);
return STATUS_FAIL;
retval = STATUS_FAIL;
goto free_buffer;
}
bufflen = min_t(int, 1052, scsi_bufflen(srb));
......@@ -4570,7 +4571,8 @@ int mg_get_ICV(struct scsi_cmnd *srb, struct rtsx_chip *chip)
set_sense_type(chip, lun, SENSE_TYPE_MEDIA_UNRECOVER_READ_ERR);
rtsx_clear_ms_error(chip);
rtsx_trace(chip);
return STATUS_FAIL;
retval = STATUS_FAIL;
goto free_buffer;
}
bufflen = min_t(int, 1028, scsi_bufflen(srb));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册