aboutsummaryrefslogtreecommitdiff
path: root/hw/ide
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2011-10-26 11:52:47 +0200
committerKevin Wolf <kwolf@redhat.com>2011-10-28 19:25:49 +0200
commitfb60105d4942a26f571b1be92a8b9e7528d0c4d8 (patch)
tree5b058285c71f5ec30c5ca3dcc2e235283919c9af /hw/ide
parent64ebe71aa0e498d24e8c02b133192142fce3a0d0 (diff)
ide: Fix off-by-one error in array index check
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/ide')
-rw-r--r--hw/ide/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 280a117fe2..29305d35f4 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2039,7 +2039,7 @@ static int ide_drive_pio_post_load(void *opaque, int version_id)
{
IDEState *s = opaque;
- if (s->end_transfer_fn_idx > ARRAY_SIZE(transfer_end_table)) {
+ if (s->end_transfer_fn_idx >= ARRAY_SIZE(transfer_end_table)) {
return -EINVAL;
}
s->end_transfer_func = transfer_end_table[s->end_transfer_fn_idx];