[PATCH] nvme-fabrics: remove superfluous nvmf_host_put in nvmf_parse_options

Hou Pu houpu.main at gmail.com
Thu Jul 8 19:32:47 PDT 2021


Opts->host is NULL there. It is checked just before. So remove
nvmf_host_put. It is introduced by commit 59a2f3f00fd7 ("nvme: fix
potential memory leak in option parsing").

Signed-off-by: Hou Pu <houpu.main at gmail.com>
---
 drivers/nvme/host/fabrics.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index a5469fd9d4c3..668c6bb7a567 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -719,7 +719,6 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 				ret = -EINVAL;
 				goto out;
 			}
-			nvmf_host_put(opts->host);
 			opts->host = nvmf_host_add(p);
 			kfree(p);
 			if (!opts->host) {
-- 
2.28.0




More information about the Linux-nvme mailing list