From c0b48da45c151987f660b897c247132dac81021f Mon Sep 17 00:00:00 2001 From: Alexander Bechikov Date: Wed, 24 Nov 2021 13:57:04 +0100 Subject: [PATCH] mbuf: fix dump of dynamic fields and flags The dump of dynamic fields and flags fails if the shm is already allocated. Add a check to fix the issue. Fixes: d4902ed31c63 ("mbuf: check shared memory before dumping dynamic space") Cc: stable@dpdk.org Signed-off-by: Alexander Bechikov Acked-by: Olivier Matz --- lib/mbuf/rte_mbuf_dyn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mbuf/rte_mbuf_dyn.c b/lib/mbuf/rte_mbuf_dyn.c index db8e020665..4ae79383b5 100644 --- a/lib/mbuf/rte_mbuf_dyn.c +++ b/lib/mbuf/rte_mbuf_dyn.c @@ -531,7 +531,7 @@ void rte_mbuf_dyn_dump(FILE *out) size_t i; rte_mcfg_tailq_write_lock(); - if (init_shared_mem() < 0) { + if (shm == NULL && init_shared_mem() < 0) { rte_mcfg_tailq_write_unlock(); return; } -- 2.20.1