Skip to contentSkip to conversation

nvme_fc: fix missing put reference on controller create failure

PATCH New James Smart 2 participants 2 messages Jun 5, 2017 – Jun 6, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme_fc: fix missing put reference on controller create failure

The failure case, of a create controller request, called nvme_uninit_ctrl() but didn't do a put to allow the nvme controller to be deleted.

Signed-off-by James Smart <james.smart at broadcom.com>
---
 drivers/nvme/host/fc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvme/host/fc.c +1 -0
index 4d1e7e1103f9..cd5e1df4399b 100644
@@ -3216,6 +3216,7 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
 		ctrl->ctrl.opts = NULL;
 		/* initiate nvme ctrl ref counting teardown */
 		nvme_uninit_ctrl(&ctrl->ctrl);
+		nvme_put_ctrl(&ctrl->ctrl);
 
 		/* as we're past the point where we transition to the ref
 		 * counting teardown path, if we return a bad pointer here,
Signature · 1 line
2.11.0
maintainer
#1 lore raw

PATCH 1/1 nvme_fc: fix missing put reference on controller create failure

Reviewed-by Sagi Grimberg <sagi at grimberg.me>