diff options
author | Hao Wu <hao.a.wu@intel.com> | 2015-12-23 01:36:31 +0000 |
---|---|---|
committer | hwu1225 <hwu1225@Edk2> | 2015-12-23 01:36:31 +0000 |
commit | 6e2692b2205065fa1caa12ea9b4799dbe0d1f0bb (patch) | |
tree | d323bb03ac939e9d49b32d2fbc5eb26e225b608a | |
parent | 69fa9171637019d22d834825f4a81f4b9da7c815 (diff) | |
download | edk2-platforms-6e2692b2205065fa1caa12ea9b4799dbe0d1f0bb.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.
(Sync patch r19449 from main trunk.)
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/branches/UDK2015@19470 6f19259b-4bc3-4df7-8a09-765794883524
-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 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);
|