From d2b6263e8f4b58d5b01bd6d6c6a71ff12e49945b Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Mon, 16 Jan 2023 14:44:40 +0100 Subject: [PATCH] fabrics: Do not overwrite errno with return code __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 --- fabrics.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fabrics.c b/fabrics.c index 5560b723..c9913f30 100644 --- a/fabrics.c +++ b/fabrics.c @@ -159,7 +159,6 @@ static nvme_ctrl_t __create_discover_ctrl(nvme_root_t r, nvme_host_t h, cfg->keep_alive_tmo = tmo; if (ret) { - errno = ret; nvme_free_ctrl(c); return NULL; } -- 2.50.1