Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: d375273c899bfa279c2732c509caf455af285006
      
https://github.com/tianocore/edk2/commit/d375273c899bfa279c2732c509caf455af285006
  Author: Yuan Yu <yua...@google.com>
  Date:   2023-02-02 (Thu, 02 Feb 2023)

  Changed paths:
    M MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c
    M MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h

  Log Message:
  -----------
  MdeModulePkg: ScsiBusDxe: Refactor DiscoverScsiDevice()

Currently DiscoverScsiDevice() returns a boolean which cannot
distinguish a "not found" situation from a real problem like
memory allocation failures.

This patch changes the return value to an EFI_STATUS so that when
memory allocation fails, it will return EFI_OUT_OF_RESOURCES.

Without this change, any FALSE returned by DiscoverScsiDevice()
will result in EFI_OUT_OF_RESOURCES being returned by
ScsiScanCreateDevice(), which will cause a while loop in
SCSIBusDriverBindingStart() to abort before other possible Puns in
the SCSI channel are scanned, which means good devices may not have
a chance to be discovered.  If this good device is the boot device,
boot will fail.

Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>
Cc: Liming Gao <gaolim...@byosoft.com.cn>
Cc: Hao A Wu <hao.a...@intel.com>
Cc: Ray Ni <ray...@intel.com>
Cc: Sivaparvathi chellaiah <sivaparvat...@ami.com>

Signed-off-by: Yuan Yu <yua...@google.com>
Reviewed-by: Hao A Wu <hao.a...@intel.com>




_______________________________________________
edk2-commits mailing list
edk2-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to