ataprint.cpp: Print error count even if error log index is invalid.

git-svn-id: http://svn.code.sf.net/p/smartmontools/code/trunk@5407 4ea69e1a-61f1-4043-bf83-b5c94c648137
pull/120/merge
chrfranke 1 month ago
parent 5ce6ff5677
commit df1591af49
  1. 4
      smartmontools/ChangeLog
  2. 7
      smartmontools/ataprint.cpp

@ -1,5 +1,9 @@
$Id$
2022-08-15 Christian Franke <franke@computer.org>
ataprint.cpp: Print error count even if error log index is invalid.
2022-08-07 Christian Franke <franke@computer.org>
drivedb.h:

@ -2194,9 +2194,9 @@ static int PrintSmartErrorlog(const ata_smart_errorlog *data,
print_on();
// If log pointer out of range, return
if (data->error_log_pointer>5){
pout("Invalid Error Log index = 0x%02x (T13/1321D rev 1c "
"Section 8.41.6.8.2.2 gives valid range from 1 to 5)\n\n",
(int)data->error_log_pointer);
pout("Invalid Error Log index = 0x%02x (valid range is from 1 to 5)\n",
data->error_log_pointer);
pout("ATA Error Count: %d (possibly also invalid)\n\n", data->ata_error_count);
return 0;
}
@ -2359,6 +2359,7 @@ static int PrintSmartExtErrorLog(ata_device * device,
// to 0.
if (!(erridx == 0 && 1 <= log->reserved1 && log->reserved1 <= nentries)) {
pout("Invalid Error Log index = 0x%04x (reserved = 0x%02x)\n", erridx, log->reserved1);
pout("Device Error Count: %d (possibly also invalid)\n\n", log->device_error_count);
return 0;
}
pout("Invalid Error Log index = 0x%04x, trying reserved byte (0x%02x) instead\n", erridx, log->reserved1);

Loading…
Cancel
Save