aboutsummaryrefslogtreecommitdiff
path: root/hw/lsi53c895a.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2010-05-21 18:44:59 +0200
committerAurelien Jarno <aurelien@aurel32.net>2010-05-22 15:32:32 +0200
commit259d5577ae546de27e25a40710f81aa031660de8 (patch)
tree359c3dc5ba0899208fb37b43f3153cf424cad844 /hw/lsi53c895a.c
parent664a65b0dbd9a4845ac7d3c21e8b103031ee57f2 (diff)
downloadqemu-259d5577ae546de27e25a40710f81aa031660de8.zip
qemu-259d5577ae546de27e25a40710f81aa031660de8.tar.gz
qemu-259d5577ae546de27e25a40710f81aa031660de8.tar.bz2
lsi: Fix value overflow in request tag processing
This fixes a mismerge of 64d564094cac5f72eeaeb950c442b773a00d3586 (wrong patch version): We need to mask the tag value properly to obtain its device ID. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'hw/lsi53c895a.c')
-rw-r--r--hw/lsi53c895a.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index 9d3c44d..f5a91ba 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -543,7 +543,7 @@ static void lsi_do_dma(LSIState *s, int out)
return;
}
- id = s->current->tag >> 8;
+ id = (s->current->tag >> 8) & 0xf;
dev = s->bus.devs[id];
if (!dev) {
lsi_bad_selection(s, id);
@@ -745,7 +745,7 @@ static void lsi_do_command(LSIState *s)
s->sfbr = buf[0];
s->command_complete = 0;
- id = s->select_tag >> 8;
+ id = (s->select_tag >> 8) & 0xf;
dev = s->bus.devs[id];
if (!dev) {
lsi_bad_selection(s, id);