* [dpdk-dev] [PATCH] memalloc: fix pointer dereferencing
@ 2019-01-08 16:46 Anatoly Burakov
2019-01-14 14:52 ` Thomas Monjalon
0 siblings, 1 reply; 2+ messages in thread
From: Anatoly Burakov @ 2019-01-08 16:46 UTC (permalink / raw)
To: dev; +Cc: stable
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 | 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 60a0a680f..ccf268679 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c
@@ -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",
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [PATCH] memalloc: fix pointer dereferencing
2019-01-08 16:46 [dpdk-dev] [PATCH] memalloc: fix pointer dereferencing Anatoly Burakov
@ 2019-01-14 14:52 ` Thomas Monjalon
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2019-01-14 14:52 UTC (permalink / raw)
To: Anatoly Burakov; +Cc: dev, stable
08/01/2019 17:46, Anatoly Burakov:
> 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>
Applied with below title, thanks:
mem: fix storing old policy
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-14 14:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-08 16:46 [dpdk-dev] [PATCH] memalloc: fix pointer dereferencing Anatoly Burakov
2019-01-14 14:52 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).