Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
return Status;\r
}\r
\r
+ //\r
+ // Simply reject device whose block size is unacceptable small (==0) or large (>64K).\r
+ //\r
+ if ((Media->BlockSize == 0) || (Media->BlockSize > USB_BOOT_MAX_CARRY_SIZE)) {\r
+ return EFI_DEVICE_ERROR;\r
+ }\r
+\r
//\r
// Detect whether it is necessary to reinstall the Block I/O Protocol.\r
//\r