summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Christensen <drc@linux.vnet.ibm.com>2019-05-08 16:02:19 -0500
committerThomas Monjalon <thomas@monjalon.net>2019-05-09 21:56:10 +0200
commit50882a1ec02173f4ef30facb5c7c18a60ef65472 (patch)
treefa73ae92ceb7bd15a91536dd4751ceae3fa9f9c9
parent834e4896a5a24d8fae72e9ad3f83bac2a537f8b8 (diff)
downloaddpdk-draft-windows-50882a1ec02173f4ef30facb5c7c18a60ef65472.zip
dpdk-draft-windows-50882a1ec02173f4ef30facb5c7c18a60ef65472.tar.gz
dpdk-draft-windows-50882a1ec02173f4ef30facb5c7c18a60ef65472.tar.xz
test/barrier: fix allocation check
Code tested calloc failures for pt & lpt variables but not for the sum variable. Add a test for calloc failure of sum. Fixes: 93da5b59afc9 ("test: introduce memory barrier test case") Cc: stable@dpdk.org Signed-off-by: David Christensen <drc@linux.vnet.ibm.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
-rw-r--r--app/test/test_barrier.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/test/test_barrier.c b/app/test/test_barrier.c
index c219d56..ae37b1e 100644
--- a/app/test/test_barrier.c
+++ b/app/test/test_barrier.c
@@ -202,7 +202,7 @@ plock_test(uint32_t iter, enum plock_use_type utype)
printf("%s(iter=%u, utype=%u) started on %u lcores\n",
__func__, iter, utype, n);
- if (pt == NULL || lpt == NULL) {
+ if (pt == NULL || lpt == NULL || sum == NULL) {
printf("%s: failed to allocate memory for %u lcores\n",
__func__, n);
free(pt);