mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-30 12:19:05 -04:00
Merge tag 'nvme-5.9-2020-10-07' of git://git.infradead.org/nvme into 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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user