summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rts5208
diff options
context:
space:
mode:
authorQuentin Lambert <lambert.quentin@gmail.com>2016-08-12 16:15:18 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-21 18:37:36 +0200
commit0b25e9fa01fc9ed333d266172128ba37d44cd7be (patch)
treee754083a4ef88ea53efb8c483e5a2dd49845abc4 /drivers/staging/rts5208
parent541e4d2d1d99c51a3bbc887b88ac3d65534b0fc9 (diff)
downloadblackbird-op-linux-0b25e9fa01fc9ed333d266172128ba37d44cd7be.tar.gz
blackbird-op-linux-0b25e9fa01fc9ed333d266172128ba37d44cd7be.zip
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: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rts5208')
-rw-r--r--drivers/staging/rts5208/ms.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c
index a0550360665f..f927ba66f7ed 100644
--- a/drivers/staging/rts5208/ms.c
+++ b/drivers/staging/rts5208/ms.c
@@ -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));
OpenPOWER on IntegriCloud