We can see this app using dd_exit to cleanup. Some error cases: spdk_bdev_get_io_channel failed for -ENOMEM, or it results in dd_open_bdev failed and then dd_exit. For a bdev, dd_exit does cleanup using spdk_put_io_channel. And spdk_put_io_channel allows `ch == NULL`. This causes SEGV. So here add a separate function to check ch, and put cleanup together. This is found by xnvme pre-test. Signed-off-by: yidong0635 <dongx.yi@intel.com> Change-Id: I9dd860da250a86f52139e69c690dd257a7ff7717 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14195 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com> |
||
---|---|---|
.. | ||
.gitignore | ||
Makefile | ||
spdk_dd.c |