Skip to content

Commit

Permalink
Merge tag 'nvme-5.9-2020-10-07' of git://git.infradead.org/nvme into …
Browse files Browse the repository at this point in the history
…block-5.9

Pull NVMe fix from Christoph:

"nvme fix for 5.9:

 - fix a recently introduced controller leak (Logan Gunthorpe)"

* tag 'nvme-5.9-2020-10-07' of git://git.infradead.org/nvme:
  nvme-core: put ctrl ref when module ref get fail
  • Loading branch information
Jens Axboe committed Oct 7, 2020
2 parents 7370997 + 4bab690 commit e0894cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/nvme/host/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3265,8 +3265,10 @@ static int nvme_dev_open(struct inode *inode, struct file *file)
}

nvme_get_ctrl(ctrl);
if (!try_module_get(ctrl->ops->module))
if (!try_module_get(ctrl->ops->module)) {
nvme_put_ctrl(ctrl);
return -EINVAL;
}

file->private_data = ctrl;
return 0;
Expand Down

0 comments on commit e0894cd

Please sign in to comment.