qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-stable] [PATCH 019/156] ide: Correct improper smart self test coun


From: Michael Roth
Subject: [Qemu-stable] [PATCH 019/156] ide: Correct improper smart self test counter reset in ide core.
Date: Tue, 8 Jul 2014 12:16:50 -0500

From: BenoƮt Canet <address@hidden>

The SMART self test counter was incorrectly being reset to zero,
not 1. This had the effect that on every 21st SMART EXECUTE OFFLINE:
 * We would write off the beginning of a dynamically allocated buffer
 * We forgot the SMART history
Fix this.

Signed-off-by: Benoit Canet <address@hidden>
Message-id: address@hidden
Reviewed-by: Markus Armbruster <address@hidden>
Cc: address@hidden
Acked-by: Kevin Wolf <address@hidden>
[PMM: tweaked commit message as per suggestions from Markus]
Signed-off-by: Peter Maydell <address@hidden>

(cherry picked from commit 940973ae0b45c9b6817bab8e4cf4df99a9ef83d7)
Signed-off-by: Michael Roth <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 e1f4c33..6007f6f 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -1601,7 +1601,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.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]