__create_discover_ctrl() is calling nvmf_add_ctrl() which sets errno
when something doesn't work. Hence we should not overwrite the errno
with the return code in __ctrl_discover_ctrl().
This prevents to propagate the errno code to the callside and the
nvme_strerror(errno) call is just return 'unknown error -1'.
Signed-off-by: Daniel Wagner <dwagner@suse.de>
cfg->keep_alive_tmo = tmo;
if (ret) {
- errno = ret;
nvme_free_ctrl(c);
return NULL;
}