mirror of https://github.com/acidanthera/audk.git
MdeModulePkg ScsiDiskDxe: Modify WriteBlocks(Ex)() to follow UEFI spec
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
This commit is contained in:
parent
7013e0885c
commit
40b0f96fd2
|
@ -692,6 +692,11 @@ ScsiDiskWriteBlocks (
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Media->ReadOnly) {
|
||||||
|
Status = EFI_WRITE_PROTECTED;
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
|
|
||||||
if (BufferSize == 0) {
|
if (BufferSize == 0) {
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
goto Done;
|
goto Done;
|
||||||
|
@ -1048,6 +1053,11 @@ ScsiDiskWriteBlocksEx (
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Media->ReadOnly) {
|
||||||
|
Status = EFI_WRITE_PROTECTED;
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
|
|
||||||
if (BufferSize == 0) {
|
if (BufferSize == 0) {
|
||||||
if ((Token != NULL) && (Token->Event != NULL)) {
|
if ((Token != NULL) && (Token->Event != NULL)) {
|
||||||
Token->TransactionStatus = EFI_SUCCESS;
|
Token->TransactionStatus = EFI_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue