From: Daniel Wagner Date: Mon, 16 Jan 2023 13:44:40 +0000 (+0100) Subject: fabrics: Do not overwrite errno with return code X-Git-Tag: v2.3~19^2~6 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d2b6263e8f4b58d5b01bd6d6c6a71ff12e49945b;p=users%2Fsagi%2Fnvme-cli.git 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 --- 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; }