[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for 2.0] ide: Correct improper smart self test count
From: |
Benoît Canet |
Subject: |
[Qemu-devel] [PATCH for 2.0] ide: Correct improper smart self test counter reset in ide core. |
Date: |
Sat, 12 Apr 2014 22:59:50 +0200 |
The counter being reseted to zero make the array index negative.
Reset it to 1.
Signed-off-by: Benoit Canet <address@hidden>
---
hw/ide/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ide/core.c b/hw/ide/core.c
index e1dfe54..c943a4d 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -1602,7 +1602,7 @@ static bool cmd_smart(IDEState *s, uint8_t cmd)
case 2: /* extended self test */
s->smart_selftest_count++;
if (s->smart_selftest_count > 21) {
- s->smart_selftest_count = 0;
+ s->smart_selftest_count = 1;
}
n = 2 + (s->smart_selftest_count - 1) * 24;
s->smart_selftest_data[n] = s->sector;
--
1.7.10.4
- [Qemu-devel] [PATCH for 2.0] ide: Correct improper smart self test counter reset in ide core.,
Benoît Canet <=