From: rsun3 Date: Tue, 19 May 2009 05:38:40 +0000 (+0000) Subject: Fix a bug in the SCSI Bus driver due to which some SCSI devices can not be discovered... X-Git-Tag: edk2-stable201903~17943 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=d1a8a1dc998e1636e6155822426973ba3f43742b;ds=sidebyside Fix a bug in the SCSI Bus driver due to which some SCSI devices can not be discovered. Per SCSI spec, the standard INQUIRY data shall contain at least 36 bytes and the length of the data is variable. The definition /// /// Standard INQUIRY data format /// typedef struct { UINT8 Peripheral_Type : 5; UINT8 Peripheral_Qualifier : 3; UINT8 DeviceType_Modifier : 7; UINT8 Rmb : 1; UINT8 Version; UINT8 Response_Data_Format; UINT8 Addnl_Length; UINT8 Reserved_5_95[95 - 5 + 1]; } EFI_SCSI_INQUIRY_DATA; is longer than 36 bytes and EFI_BAD_BUFFER_SIZE may be returned if the actual inquiry data is less than that of EFI_SCSI_INQUIRY_DATA. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8329 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c index 4d8eff6eee..2a765460b2 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c +++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c @@ -1123,7 +1123,7 @@ DiscoverScsiDevice ( &InquiryDataLength, FALSE ); - if (EFI_ERROR (Status)) { + if (EFI_ERROR (Status) && Status != EFI_BAD_BUFFER_SIZE) { return FALSE; } //