aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zvol.c
diff options
context:
space:
mode:
authorTom Caputi <[email protected]>2019-01-23 14:38:05 -0500
committerBrian Behlendorf <[email protected]>2019-01-23 11:38:05 -0800
commitb5d693581d6238942997e1493ddfafa30b1e28f2 (patch)
treef39398df6016eae8fdaf7770b406db73cf070695 /module/zfs/zvol.c
parent0a10863194b0e7c1c64f702f868c10d5dac45ea5 (diff)
Fix bad kmem_free() in zvol_rename_minors_impl()
Currently, zvol_rename_minors_impl() calls kmem_asprintf() to allocate and initialize a string. This function is a thin wrapper around the kernel's kvasprintf() and does not call into the SPL's kmem tracking code when it is enabled. However, this function frees the string with the tracked kmem_free() instead of the untracked strfree(), which causes the SPL kmem tracking code to believe that the function is attempting to free memory it never allocated, triggering an ASSERT. This patch simply corrects this issue. Reviewed by: Matt Ahrens <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tom Caputi <[email protected]> Closes #8307
Diffstat (limited to 'module/zfs/zvol.c')
-rw-r--r--module/zfs/zvol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c
index 7395dcb8d..7ca18e138 100644
--- a/module/zfs/zvol.c
+++ b/module/zfs/zvol.c
@@ -2267,7 +2267,7 @@ zvol_rename_minors_impl(const char *oldname, const char *newname)
zv->zv_name[oldnamelen],
zv->zv_name + oldnamelen + 1);
zvol_rename_minor(zv, name);
- kmem_free(name, strlen(name + 1));
+ strfree(name);
}
mutex_exit(&zv->zv_state_lock);