diff options
author | Adam Manzanares <a.manzanares@samsung.com> | 2021-10-13 18:04:19 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2021-10-14 09:07:47 +0300 |
commit | be5eb933542629ad6a7d4c92097b1b472b1612d0 (patch) | |
tree | 10f011cf9460d5e6b4051493750d9214e30a0b45 /drivers/nvme/host/multipath.c | |
parent | 85f74acf097a63a07f5a7c215db6883e5c35e3ff (diff) | |
download | linux-be5eb933542629ad6a7d4c92097b1b472b1612d0.tar.xz |
nvme: fix per-namespace chardev deletion
Decrease reference count of chardevice during char device deletion in
order to fix a memory leak. Add a release callabck for the device
associated chardev and move ida_simple_remove into the release function.
Fixes: 2637baed7801 ("nvme: introduce generic per-namespace chardev")
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Suggested-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Adam Manzanares <a.manzanares@samsung.com>
Reviewed-by: Javier González <javier@javigon.com>
Tested-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/host/multipath.c')
-rw-r--r-- | drivers/nvme/host/multipath.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index e8ccdd398f78..fba06618c6c2 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -431,8 +431,6 @@ static int nvme_add_ns_head_cdev(struct nvme_ns_head *head) return ret; ret = nvme_cdev_add(&head->cdev, &head->cdev_device, &nvme_ns_head_chr_fops, THIS_MODULE); - if (ret) - kfree_const(head->cdev_device.kobj.name); return ret; } |