mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
nand: fix address overflow
The shifts of the address mask and value shift beyond 32 bits when there are 5 address cycles. Cc: qemu-stable@nongnu.org Signed-off-by: Rabin Vincent <rabin.vincent@axis.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
ab9b872ab3
commit
a184e74f24
1 changed files with 2 additions and 2 deletions
|
@ -522,8 +522,8 @@ void nand_setio(DeviceState *dev, uint32_t value)
|
|||
|
||||
if (s->ale) {
|
||||
unsigned int shift = s->addrlen * 8;
|
||||
unsigned int mask = ~(0xff << shift);
|
||||
unsigned int v = value << shift;
|
||||
uint64_t mask = ~(0xffull << shift);
|
||||
uint64_t v = (uint64_t)value << shift;
|
||||
|
||||
s->addr = (s->addr & mask) | v;
|
||||
s->addrlen ++;
|
||||
|
|
Loading…
Reference in a new issue