summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
index 238718501c..033be23963 100644
--- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
+++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
@@ -3659,6 +3659,8 @@ ScsiDiskAsyncRead10 (
SCSI_ASYNC_RW_REQUEST *Request;
EFI_EVENT AsyncIoEvent;
+ AsyncIoEvent = NULL;
+
Request = AllocateZeroPool (sizeof (SCSI_ASYNC_RW_REQUEST));
if (Request == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -3714,6 +3716,10 @@ ScsiDiskAsyncRead10 (
return EFI_SUCCESS;
ErrorExit:
+ if (AsyncIoEvent != NULL) {
+ gBS->CloseEvent (AsyncIoEvent);
+ }
+
if (Request != NULL) {
if (Request->SenseData != NULL) {
FreePool (Request->SenseData);
@@ -3762,6 +3768,8 @@ ScsiDiskAsyncWrite10 (
SCSI_ASYNC_RW_REQUEST *Request;
EFI_EVENT AsyncIoEvent;
+ AsyncIoEvent = NULL;
+
Request = AllocateZeroPool (sizeof (SCSI_ASYNC_RW_REQUEST));
if (Request == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -3817,6 +3825,10 @@ ScsiDiskAsyncWrite10 (
return EFI_SUCCESS;
ErrorExit:
+ if (AsyncIoEvent != NULL) {
+ gBS->CloseEvent (AsyncIoEvent);
+ }
+
if (Request != NULL) {
if (Request->SenseData != NULL) {
FreePool (Request->SenseData);
@@ -3865,6 +3877,8 @@ ScsiDiskAsyncRead16 (
SCSI_ASYNC_RW_REQUEST *Request;
EFI_EVENT AsyncIoEvent;
+ AsyncIoEvent = NULL;
+
Request = AllocateZeroPool (sizeof (SCSI_ASYNC_RW_REQUEST));
if (Request == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -3920,6 +3934,10 @@ ScsiDiskAsyncRead16 (
return EFI_SUCCESS;
ErrorExit:
+ if (AsyncIoEvent != NULL) {
+ gBS->CloseEvent (AsyncIoEvent);
+ }
+
if (Request != NULL) {
if (Request->SenseData != NULL) {
FreePool (Request->SenseData);
@@ -3968,6 +3986,8 @@ ScsiDiskAsyncWrite16 (
SCSI_ASYNC_RW_REQUEST *Request;
EFI_EVENT AsyncIoEvent;
+ AsyncIoEvent = NULL;
+
Request = AllocateZeroPool (sizeof (SCSI_ASYNC_RW_REQUEST));
if (Request == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -4023,6 +4043,10 @@ ScsiDiskAsyncWrite16 (
return EFI_SUCCESS;
ErrorExit:
+ if (AsyncIoEvent != NULL) {
+ gBS->CloseEvent (AsyncIoEvent);
+ }
+
if (Request != NULL) {
if (Request->SenseData != NULL) {
FreePool (Request->SenseData);