diff options
author | Hao Wu <hao.a.wu@intel.com> | 2015-12-22 13:56:30 +0000 |
---|---|---|
committer | hwu1225 <hwu1225@Edk2> | 2015-12-22 13:56:30 +0000 |
commit | 1f09197d196b2a1befaa587e0504d0f2f408f594 (patch) | |
tree | fad05ab9af2ba5d0c3db9bbbea0275a4f35446fa /MdeModulePkg/Bus | |
parent | fbbb3ff3e03ba6ea31f14e7061e1db00cb73ed67 (diff) | |
download | edk2-platforms-1f09197d196b2a1befaa587e0504d0f2f408f594.tar.xz |
MdeModulePkg ScsiDiskDxe: Close event when SCSI command fails
The functions ScsiRead10CommandEx(), ScsiWrite10CommandEx(),
ScsiRead16CommandEx() and ScsiWrite16CommandEx() in UefiScsiLib will not
signal the event passed from ScsiDiskDxe when error occurs.
In this case, ScsiDiskDxe should close the event passing to these APIs in
UefiScsiLib.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19449 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus')
-rw-r--r-- | MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c index 3e19fad064..ba7f5a5f77 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c @@ -3700,6 +3700,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;
@@ -3755,6 +3757,10 @@ ScsiDiskAsyncRead10 ( return EFI_SUCCESS;
ErrorExit:
+ if (AsyncIoEvent != NULL) {
+ gBS->CloseEvent (AsyncIoEvent);
+ }
+
if (Request != NULL) {
if (Request->SenseData != NULL) {
FreePool (Request->SenseData);
@@ -3803,6 +3809,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;
@@ -3858,6 +3866,10 @@ ScsiDiskAsyncWrite10 ( return EFI_SUCCESS;
ErrorExit:
+ if (AsyncIoEvent != NULL) {
+ gBS->CloseEvent (AsyncIoEvent);
+ }
+
if (Request != NULL) {
if (Request->SenseData != NULL) {
FreePool (Request->SenseData);
@@ -3906,6 +3918,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;
@@ -3961,6 +3975,10 @@ ScsiDiskAsyncRead16 ( return EFI_SUCCESS;
ErrorExit:
+ if (AsyncIoEvent != NULL) {
+ gBS->CloseEvent (AsyncIoEvent);
+ }
+
if (Request != NULL) {
if (Request->SenseData != NULL) {
FreePool (Request->SenseData);
@@ -4009,6 +4027,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;
@@ -4064,6 +4084,10 @@ ScsiDiskAsyncWrite16 ( return EFI_SUCCESS;
ErrorExit:
+ if (AsyncIoEvent != NULL) {
+ gBS->CloseEvent (AsyncIoEvent);
+ }
+
if (Request != NULL) {
if (Request->SenseData != NULL) {
FreePool (Request->SenseData);
|