From 27ff8384deaca2f7727d0cedf2053aa13fbae1e2 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Thu, 14 Jan 2021 15:02:45 +0000 Subject: [PATCH] fbarray: fix overlap check When we're attaching fbarrays in secondary processes, we check for whether the intended memory address for the fbarray is already in use by some other, local fbarray. However, the check for end-overlap (i.e. to see if our memory area's end overlaps with some other fbarray) is incorrectly counting end offset as part of the overlap. Fix the check. Fixes: 5b61c62cfd76 ("fbarray: add internal tailq for mapped areas") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov Tested-by: Zhihong Peng --- lib/librte_eal/common/eal_common_fbarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_fbarray.c b/lib/librte_eal/common/eal_common_fbarray.c index 1220e2bae9..d974f3dab7 100644 --- a/lib/librte_eal/common/eal_common_fbarray.c +++ b/lib/librte_eal/common/eal_common_fbarray.c @@ -110,7 +110,7 @@ overlap(const struct mem_area *ma, const void *start, size_t len) if (start >= ma_start && start < ma_end) return 1; /* end overlap? */ - if (end >= ma_start && end < ma_end) + if (end > ma_start && end < ma_end) return 1; return 0; } -- 2.20.1