The functions ScsiDiskWriteBlocks(Ex) in ScsiDiskDxe/ScsiDisk.c do not
check whether the device is allow to be written originally.
This commit will add read-only check to follow the UEFI spec.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19445
6f19259b-4bc3-4df7-8a09-
765794883524
goto Done;\r
}\r
\r
+ if (Media->ReadOnly) {\r
+ Status = EFI_WRITE_PROTECTED;\r
+ goto Done;\r
+ }\r
+\r
if (BufferSize == 0) {\r
Status = EFI_SUCCESS;\r
goto Done;\r
goto Done;\r
}\r
\r
+ if (Media->ReadOnly) {\r
+ Status = EFI_WRITE_PROTECTED;\r
+ goto Done;\r
+ }\r
+\r
if (BufferSize == 0) {\r
if ((Token != NULL) && (Token->Event != NULL)) {\r
Token->TransactionStatus = EFI_SUCCESS;\r