From 5e6df556f60a1b0d94cef1dbbd984186037a9a1a Mon Sep 17 00:00:00 2001 From: Jianfeng Tan Date: Thu, 26 Apr 2018 08:06:53 +0000 Subject: [PATCH] mem: fix resize return handling for --single-file-segments resize_hugefile() returns either 0 (which indicates success) or -1 (which indicates failure). We failed to check the success as we use --single-file-segments option. Fixes: 2a04139f66b4 ("eal: add single file segments option") Signed-off-by: Jianfeng Tan Acked-by: Anatoly Burakov --- 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 1f553dd2a6..301c34ee7b 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c +++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c @@ -419,7 +419,7 @@ alloc_seg(struct rte_memseg *ms, void *addr, int socket_id, if (internal_config.single_file_segments) { map_offset = seg_idx * alloc_sz; ret = resize_hugefile(fd, map_offset, alloc_sz, true); - if (ret < 1) + if (ret < 0) goto resized; } else { map_offset = 0; -- 2.20.1