|
@@ -111,8 +111,17 @@ retry_next:
|
|
|
if (rc)
|
|
|
goto out;
|
|
|
/* no more record */
|
|
|
- if (id == APEI_ERST_INVALID_RECORD_ID)
|
|
|
+ if (id == APEI_ERST_INVALID_RECORD_ID) {
|
|
|
+ /*
|
|
|
+ * If the persistent store is empty initially, the function
|
|
|
+ * 'erst_read' below will return "-ENOENT" value. This causes
|
|
|
+ * 'retry_next' label is entered again. The returned value
|
|
|
+ * should be zero indicating the read operation is EOF.
|
|
|
+ */
|
|
|
+ len = 0;
|
|
|
+
|
|
|
goto out;
|
|
|
+ }
|
|
|
retry:
|
|
|
rc = len = erst_read(id, erst_dbg_buf, erst_dbg_buf_len);
|
|
|
/* The record may be cleared by others, try read next record */
|