diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2013-06-05 17:13:05 +0200 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2013-06-11 18:17:25 -0500 |
commit | 1fb147f4431759a442b024db47e9904cf0d90131 (patch) | |
tree | a2bed6fc938d87f421b19330b11376a40cd78959 /hw/s390x | |
parent | 72762f28110e15ab88aea70ef09575fb1ff89b38 (diff) | |
download | qemu-1fb147f4431759a442b024db47e9904cf0d90131.zip qemu-1fb147f4431759a442b024db47e9904cf0d90131.tar.gz qemu-1fb147f4431759a442b024db47e9904cf0d90131.tar.bz2 |
virtio-ccw: Fix unsetting of indicators.
Interpretation of the ccws to register (configuration) indicators contained
a thinko: We want to disallow reading from 0, but setting the indicator
pointer to 0 is fine.
Let's fix the handling for CCW_CMD_SET{,_CONF}_IND.
Cc: qemu-stable@nongnu.org
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
(cherry picked from commit d1db1fa8dfcea9c62643f624f2a07d2fd375ce45)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'hw/s390x')
-rw-r--r-- | hw/s390x/virtio-ccw.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 5f5e267..44f5772 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -328,10 +328,10 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) ret = -EINVAL; break; } - indicators = ldq_phys(ccw.cda); - if (!indicators) { + if (!ccw.cda) { ret = -EFAULT; } else { + indicators = ldq_phys(ccw.cda); dev->indicators = indicators; sch->curr_status.scsw.count = ccw.count - sizeof(indicators); ret = 0; @@ -348,10 +348,10 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) ret = -EINVAL; break; } - indicators = ldq_phys(ccw.cda); - if (!indicators) { + if (!ccw.cda) { ret = -EFAULT; } else { + indicators = ldq_phys(ccw.cda); dev->indicators2 = indicators; sch->curr_status.scsw.count = ccw.count - sizeof(indicators); ret = 0; |