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: Quentin Lambert <lambert.quentin@xxxxxxxxx> --- drivers/staging/rts5208/ms.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/staging/rts5208/ms.c +++ b/drivers/staging/rts5208/ms.c @@ -4328,7 +4328,8 @@ int mg_get_local_EKB(struct scsi_cmnd *s 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)); @@ -4581,7 +4582,8 @@ int mg_get_ICV(struct scsi_cmnd *srb, st 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)); -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html