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 <hemant.agrawal@nxp.com>
Tested-by: Thomas Monjalon <thomas@monjalon.net>
This commit is contained in:
Hemant Agrawal 2019-07-17 21:25:18 +05:30 committed by Thomas Monjalon
parent 135393d456
commit 46418d25f7

View File

@ -296,7 +296,7 @@ jump_out:
return 0;
err_out:
if (sep)
if (!sep_exists && sep)
free(sep);
return -EINVAL;
}