]> git.proxmox.com Git - qemu.git/commit
hw/pflash_cfi01: Treat read in unknown command state as read
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 28 Feb 2013 18:23:12 +0000 (18:23 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 28 Feb 2013 18:23:12 +0000 (18:23 +0000)
commit1be97bf22447088adebf23b1ca508d4bb00f853c
tree253cf110e96f1ebaec0a516f548aea77ee405d6e
parent6e392787c85809671033ec419d8e8ecf684d55da
hw/pflash_cfi01: Treat read in unknown command state as read

The code for handling the default "unknown command state" case in
pflash_read in pflash_cfi01.c comments "reset state & treat it as
a read". However the code doesn't actually do this. Moving the
default case to the top of the switch so it can fall through into
the read case brings this file into line with pflash_cfi02 and
makes the code behave as the comments suggest.

The pflash_cfi01 code has always had this bug -- it was presumably
introduced when the original author copied the cfi02 code and
rearranged the order of the switch statement without noticing
that the default case relied on the fall-through.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Tested-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-id: 1358777318-7579-3-git-send-email-peter.maydell@linaro.org
hw/pflash_cfi01.c