diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2013-04-28 18:38:47 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-05-01 14:11:05 -0500 |
commit | ecc360f5479f8174e640835619b4f02eadad3459 (patch) | |
tree | 0bd7af9b468c53559f6b93b4036e2950c6c2e563 /src/usr/trace | |
parent | c9be87b42af523b35b1bcb727527341ecd9a5fd4 (diff) | |
download | talos-hostboot-ecc360f5479f8174e640835619b4f02eadad3459.tar.gz talos-hostboot-ecc360f5479f8174e640835619b4f02eadad3459.zip |
Race condition in extract-trace.
Change-Id: If1445116f7520e010cad74d9f7227ae7889ef935
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4254
Tested-by: Jenkins Server
Reviewed-by: Dean Sanner <dsanner@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/trace')
-rw-r--r-- | src/usr/trace/buffer.C | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/usr/trace/buffer.C b/src/usr/trace/buffer.C index 921b5f2a4..1b1d64736 100644 --- a/src/usr/trace/buffer.C +++ b/src/usr/trace/buffer.C @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012 */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ /* */ /* p1 */ /* */ @@ -464,7 +464,7 @@ namespace TRACE size_t l_totalSize = l_size; Entry* entry = i_comp->iv_first; - Entry* orig_entry = entry; + size_t l_entriesToExtract = 0; do { @@ -482,6 +482,7 @@ namespace TRACE if ((l_totalSize + entry->size + sizeof(uint32_t)) <= i_size) { l_totalSize += entry->size + sizeof(uint32_t); + l_entriesToExtract++; if ((entry->next) && (entry->next->comp)) @@ -507,7 +508,7 @@ namespace TRACE } // Now we can actually copy all the entries... - while(1) + while(entry != NULL) { // Copy entry data. memcpy(&l_data[l_size], &entry->data[0],entry->size); @@ -520,7 +521,7 @@ namespace TRACE l_entries++; - if (entry == orig_entry) + if (l_entries == l_entriesToExtract) { break; } |