Skip to content

Commit e0894cd

Browse files
committed
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
2 parents 7370997 + 4bab690 commit e0894cd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/nvme/host/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3265,8 +3265,10 @@ static int nvme_dev_open(struct inode *inode, struct file *file)
32653265
}
32663266

32673267
nvme_get_ctrl(ctrl);
3268-
if (!try_module_get(ctrl->ops->module))
3268+
if (!try_module_get(ctrl->ops->module)) {
3269+
nvme_put_ctrl(ctrl);
32693270
return -EINVAL;
3271+
}
32703272

32713273
file->private_data = ctrl;
32723274
return 0;

0 commit comments

Comments
 (0)