From: Anatoly Burakov Date: Mon, 16 Apr 2018 16:18:55 +0000 (+0100) Subject: mem: fix comparison of old policy X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=8ee25c7e81fcccfd14bd39f8ff87459ced9a3581;p=dpdk.git 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 --- 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) {