diff options
| author | Tianjia Zhang | 2020-02-07 12:54:33 +0100 |
|---|---|---|
| committer | Stefan Hajnoczi | 2020-03-06 11:35:15 +0100 |
| commit | 1f40ace7b5634f93801c8474b9eb77fe2e00289c (patch) | |
| tree | e4772d11568f1d03e3e1748df8f767f35d9d8612 /tests | |
| parent | qtest: fix fuzzer-related 80-char limit violations (diff) | |
| download | qemu-1f40ace7b5634f93801c8474b9eb77fe2e00289c.tar.gz qemu-1f40ace7b5634f93801c8474b9eb77fe2e00289c.tar.xz qemu-1f40ace7b5634f93801c8474b9eb77fe2e00289c.zip | |
tests: Fix a bug with count variables
The counting code here should use the local variable n_nodes_local.
Otherwise, the variable n_nodes is counting incorrectly, causing the
counting logic of the code to be wrong.
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Link: https://lore.kernel.org/r/20200207115433.118254-1-tianjia.zhang@linux.alibaba.com
Message-Id: <20200207115433.118254-1-tianjia.zhang@linux.alibaba.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-rcu-list.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test-rcu-list.c b/tests/test-rcu-list.c index 1442c0c982..92be51ec50 100644 --- a/tests/test-rcu-list.c +++ b/tests/test-rcu-list.c @@ -235,7 +235,7 @@ static void *rcu_q_updater(void *arg) j++; if (target_el == j) { struct list_element *new_el = g_new(struct list_element, 1); - n_nodes += n_nodes_local; + n_nodes_local++; TEST_LIST_INSERT_AFTER_RCU(el, new_el, entry); break; } |
