diff options
author | Sivaparvathi C <sivaparvathic@ami.com> | 2022-10-27 16:36:59 +0530 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-11-04 03:59:20 +0000 |
commit | eae9e51d98d5eed708c512670b9381d3597a766e (patch) | |
tree | 1b929a9ca00bd875d17f546462edc30f430a55b6 /MdeModulePkg | |
parent | b84f32ae5b475ce657ea1c9db29d4e4ec7711948 (diff) | |
download | edk2-eae9e51d98d5eed708c512670b9381d3597a766e.tar.gz |
MdeModulePkg/scsi :Coverity scan flags multiple issues in edk2-stable202205
Added changes to resolve the SCSI driver Coverity issues.
Cc: Vasudevan Sambandan <vasudevans@ami.com>
Cc: Sundaresan Selvaraj <sundaresans@ami.com>
Signed-off-by: Sivaparvathi chellaiah <sivaparvathic@ami.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c | 5 | ||||
-rw-r--r-- | MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c | 24 |
2 files changed, 19 insertions, 10 deletions
diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c index 9ea69ee740..fbe14c7724 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c +++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c @@ -3,6 +3,8 @@ Extended SCSI Pass Thru protocol in the system.
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1985 - 2022, American Megatrends International LLC.<BR>
+
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -531,6 +533,9 @@ SCSIBusDriverBindingStart ( // then create handle and install scsi i/o protocol.
//
Status = ScsiScanCreateDevice (This, Controller, &ScsiTargetId, Lun, ScsiBusDev);
+ if (Status == EFI_OUT_OF_RESOURCES) {
+ goto ErrorExit;
+ }
}
return EFI_SUCCESS;
diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c index 0928605dc4..6555aeed7d 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c @@ -3,6 +3,10 @@ Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
Copyright (c) 1985 - 2022, American Megatrends International LLC.<BR>
+<<<<<<< HEAD
+=======
+
+>>>>>>> ace365b4e0 (MdeModulePkg/scsi :Coverity scan flags multiple issues in edk2-stable202205)
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -4296,7 +4300,7 @@ BackOff: if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR (ReturnStatus))) {
DEBUG ((DEBUG_ERROR, "ScsiDiskRead10: Check Condition happened!\n"));
- Status = DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action);
+ DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action);
if (Action == ACTION_RETRY_COMMAND_LATER) {
*NeedRetry = TRUE;
return EFI_DEVICE_ERROR;
@@ -4420,7 +4424,7 @@ BackOff: if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR (ReturnStatus))) {
DEBUG ((DEBUG_ERROR, "ScsiDiskWrite10: Check Condition happened!\n"));
- Status = DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action);
+ DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action);
if (Action == ACTION_RETRY_COMMAND_LATER) {
*NeedRetry = TRUE;
return EFI_DEVICE_ERROR;
@@ -4543,7 +4547,7 @@ BackOff: if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR (ReturnStatus))) {
DEBUG ((DEBUG_ERROR, "ScsiDiskRead16: Check Condition happened!\n"));
- Status = DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action);
+ DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action);
if (Action == ACTION_RETRY_COMMAND_LATER) {
*NeedRetry = TRUE;
return EFI_DEVICE_ERROR;
@@ -4667,7 +4671,7 @@ BackOff: if ((TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) || (EFI_ERROR (ReturnStatus))) {
DEBUG ((DEBUG_ERROR, "ScsiDiskWrite16: Check Condition happened!\n"));
- Status = DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action);
+ DetectMediaParsingSenseKeys (ScsiDiskDevice, ScsiDiskDevice->SenseData, SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA), &Action);
if (Action == ACTION_RETRY_COMMAND_LATER) {
*NeedRetry = TRUE;
return EFI_DEVICE_ERROR;
@@ -4777,12 +4781,12 @@ ScsiDiskNotify ( if (Request->TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) {
DEBUG ((DEBUG_ERROR, "ScsiDiskNotify: Check Condition happened!\n"));
- Status = DetectMediaParsingSenseKeys (
- ScsiDiskDevice,
- Request->SenseData,
- Request->SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA),
- &Action
- );
+ DetectMediaParsingSenseKeys (
+ ScsiDiskDevice,
+ Request->SenseData,
+ Request->SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA),
+ &Action
+ );
if (Action == ACTION_RETRY_COMMAND_LATER) {
if (++Request->TimesRetry > MaxRetry) {
Token->TransactionStatus = EFI_DEVICE_ERROR;
|