]> Git Repo - qemu.git/commit
m25p80: Improve command handling for unsupported commands
authorGuenter Roeck <[email protected]>
Mon, 16 Mar 2020 15:52:24 +0000 (15:52 +0000)
committerPeter Maydell <[email protected]>
Tue, 17 Mar 2020 11:36:42 +0000 (11:36 +0000)
commit9c85bcd8f5f9f775e8305e580cf5fbc5b7ba2c28
treed878721945f4893353581a7e4a711513a804d860
parentf3ee222f0c5f3681c28991313f76773e6cfed777
m25p80: Improve command handling for unsupported commands

Whenever an unsupported command is encountered, the current code
interprets each transferred byte as new command. Most of the time, those
'commands' are interpreted as new unknown commands. However, in rare
cases, it may be that for example address or length information
passed with the original command is by itself a valid command.
If that happens, the state machine may get completely confused and,
worst case, start writing data into the flash or even erase it.

To avoid the problem, transition into STATE_READING_DATA and keep
sending a value of 0 until the chip is deselected after encountering
an unsupported command.

Signed-off-by: Guenter Roeck <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Cédric Le Goater <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
hw/block/m25p80.c
This page took 0.02434 seconds and 4 git commands to generate.