]> git.droids-corp.org - dpdk.git/commitdiff
mem: fix storing old policy
authorAnatoly Burakov <anatoly.burakov@intel.com>
Tue, 8 Jan 2019 16:46:28 +0000 (16:46 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 14 Jan 2019 14:50:52 +0000 (15:50 +0100)
The original code was supposed to overwrite the value pointed to
by the pointer, but the new one is instead overwriting the
pointer value itself, which has no effect outside that function.
Fix it by adding a pointer dereference.

Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/linuxapp/eal/eal_memalloc.c

index 5b421f1d7070bd24c2b36c9833c2b920434d04ac..b6fb183db4b7fa0501cd61d6243dde52486c128f 100644 (file)
@@ -176,7 +176,7 @@ prepare_numa(int *oldpolicy, struct bitmask *oldmask, int socket_id)
                RTE_LOG(ERR, EAL,
                        "Failed to get current mempolicy: %s. "
                        "Assuming MPOL_DEFAULT.\n", strerror(errno));
-               oldpolicy = MPOL_DEFAULT;
+               *oldpolicy = MPOL_DEFAULT;
        }
        RTE_LOG(DEBUG, EAL,
                "Setting policy MPOL_PREFERRED for socket %d\n",