public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2] [PATCH]MdeModulePkg\scsi: Coverity scan flags multiple issues in edk2-stable202205
@ 2022-08-02  5:00 sivaparvathi C
  2022-08-05  5:48 ` 回复: [edk2-devel] " gaoliming
  0 siblings, 1 reply; 11+ messages in thread
From: sivaparvathi C @ 2022-08-02  5:00 UTC (permalink / raw)
  To: devel@edk2.groups.io
  Cc: Vasudevan Sambandan, Sundaresan S, Sivaparvathi Chellaiah

 Attached changes to resolve the coverity Issues

 Signed-off-by: sivaparvathic@ami.com
To: sivaparvathic@ami.com

---
 MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c   |  3 +++
 MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c | 10 +++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
index 9ea69ee740..2cc61bb942 100644
--- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
+++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
@@ -531,6 +531,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 98e84b4ea8..5f4ead7669 100644
--- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
+++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
@@ -4247,7 +4247,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;

@@ -4371,7 +4371,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;

@@ -4494,7 +4494,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;

@@ -4618,7 +4618,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;

@@ -4728,7 +4728,7 @@ ScsiDiskNotify (
   if (Request->TargetStatus == EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION) {

     DEBUG ((DEBUG_ERROR, "ScsiDiskNotify: Check Condition happened!\n"));



-    Status = DetectMediaParsingSenseKeys (

+    DetectMediaParsingSenseKeys (

                ScsiDiskDevice,

                Request->SenseData,

                Request->SenseDataLength / sizeof (EFI_SCSI_SENSE_DATA),

--
2.31.0.windows.1
-The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-11-01  1:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-02  5:00 [edk2] [PATCH]MdeModulePkg\scsi: Coverity scan flags multiple issues in edk2-stable202205 sivaparvathi C
2022-08-05  5:48 ` 回复: [edk2-devel] " gaoliming
2022-09-12  9:04   ` [edk2-devel] " sivaparvathi C
2022-09-13  5:18     ` 回复: " gaoliming
2022-10-06  7:56       ` [edk2-devel] " sivaparvathi C
2022-10-08  1:50         ` 回复: " gaoliming
2022-10-10  2:57           ` Michael D Kinney
2022-10-13 11:15             ` sivaparvathi C
2022-10-13 14:22               ` Michael D Kinney
2022-10-28  8:02                 ` sivaparvathi C
2022-11-01  1:53                   ` 回复: " gaoliming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox