mirror of https://gitee.com/openkylin/qemu.git
hw/block: m25p80: Don't write to flash if write is disabled
When write is disabled, the write to flash should be avoided
in flash_write8().
Fixes: 82a2499011
("m25p80: Initial implementation of SPI flash device")
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Message-id: 1608688825-81519-1-git-send-email-bmeng.cn@gmail.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
825a215c00
commit
1695854b37
|
@ -601,6 +601,7 @@ void flash_write8(Flash *s, uint32_t addr, uint8_t data)
|
|||
|
||||
if (!s->write_enable) {
|
||||
qemu_log_mask(LOG_GUEST_ERROR, "M25P80: write with write protect!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if ((prev ^ data) & data) {
|
||||
|
|
Loading…
Reference in New Issue