From: Hemant Agrawal Date: Wed, 17 Jul 2019 15:55:18 +0000 (+0530) Subject: bus/fslmc: fix error handling in device iterator X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=46418d25f79ed6c59a981798beeda652f079e3dd;p=dpdk.git 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 --- 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; }