From 8ee25c7e81fcccfd14bd39f8ff87459ced9a3581 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Mon, 16 Apr 2018 17:18:55 +0100 Subject: [PATCH] mem: fix comparison of old policy Previous code had an old rebase leftover from the time when oldpolicy was an actual int, instead of a pointer. Fix it to do comparison with dereferencing the pointer. Coverity issue: 272589 Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime") Signed-off-by: Anatoly Burakov Acked-by: Bruce Richardson --- lib/librte_eal/linuxapp/eal/eal_memalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxapp/eal/eal_memalloc.c index 6f0eda5d8f..174b1b7525 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c +++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c @@ -146,7 +146,7 @@ resotre_numa(int *oldpolicy, struct bitmask *oldmask) { RTE_LOG(DEBUG, EAL, "Restoring previous memory policy: %d\n", *oldpolicy); - if (oldpolicy == MPOL_DEFAULT) { + if (*oldpolicy == MPOL_DEFAULT) { numa_set_localalloc(); } else if (set_mempolicy(*oldpolicy, oldmask->maskp, oldmask->size + 1) < 0) { -- 2.20.1