nvdimm: change to use generic kvfree()
PATCH 1/1 nvdimm: change to use generic kvfree()
Signed-off-by yalin wang <[email protected]>
--- drivers/nvdimm/dimm_devs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/nvdimm/dimm_devs.c +1 -4
@@ -241,10 +241,7 @@ void nvdimm_drvdata_release(struct kref *kref)nvdimm_free_dpa (ndd, res);nvdimm_bus_unlock (dev); -if (ndd->data &&is_vmalloc_addr (ndd->data)) -vfree (ndd->data); -else -kfree (ndd->data); +kvfree (ndd->data);kfree (ndd);put_device (dev); }
Signature · 1 line
1.9.1
Quoted 11 lines · yalin wang
Signed-off-by yalin wang <[email protected]>--- drivers/nvdimm/dimm_devs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/nvdimm/dimm_devs.c +0
-0@@ -241,10 +241,7 @@ void nvdimm_drvdata_release(struct kref *kref)nvdimm_free_dpa (ndd, res);
drivers/nvdimm/dimm_devs.c void nvdimm_drvdata_release(struct kref *kref) · line 247
Quoted 10 lines
drivers/nvdimm/dimm_devs.c +1
-4nvdimm_bus_unlock (dev); -if (ndd->data &&is_vmalloc_addr (ndd->data)) -vfree (ndd->data); -else -kfree (ndd->data); +kvfree (ndd->data);kfree (ndd);put_device (dev); }
This seems fine. You're skipping the existing check to see if ndd->data is NULL, but I think that is handled implicitly by is_vmalloc_addr() since NULL won't be in the vmalloc address range.
Reviewed-by Ross Zwisler <[email protected]>