From 46418d25f79ed6c59a981798beeda652f079e3dd Mon Sep 17 00:00:00 2001 From: Hemant Agrawal Date: Wed, 17 Jul 2019 21:25:18 +0530 Subject: [PATCH] bus/fslmc: fix error handling in device iterator When initializing EAL with "-w 0:0.0", this error is blocking: munmap_chunk(): invalid pointer ElectricFence reports this root cause: free(7fffeec25a11): address not from malloc() Fixes: e67a61614d0b ("bus/fslmc: support device iteration") Signed-off-by: Hemant Agrawal Tested-by: Thomas Monjalon --- drivers/bus/fslmc/fslmc_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index a2ed3bcc97..9e4146abac 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -296,7 +296,7 @@ jump_out: return 0; err_out: - if (sep) + if (!sep_exists && sep) free(sep); return -EINVAL; } -- 2.20.1