diff options
author | Brian Behlendorf <[email protected]> | 2014-04-17 10:06:37 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-04-18 13:30:15 -0700 |
commit | 4fd762f8ad59f5840c790357a0e50f15cc9ccc08 (patch) | |
tree | ec50cf35c30976352ccfd38217a09010d71f7f7b /patches | |
parent | e0b8f6290216a3d10af008a160617d89517fc631 (diff) |
Fix zfsdev_ioctl() kmem leak warning
Due to an asymmetry in the kmem accounting a memory leak was being
reported when it was only an accounting issue. All memory allocated
with kmem_alloc() must be released with kmem_free() or it will not
be properly accounted for.
In this case the code used strfree() to release the memory allocated
by kmem_alloc(). Presumably this was done because the size of the
memory region wasn't available when the memory needed to be freed.
To resolve this issue the code has been updated to use strdup() instead
of kmem_alloc() to allocate the memory. Like strfree(), strdup() is
not integrated with the memory accounting. This means we can use
strfree() to release it like Illumos.
SPL: kmem leaked 10/4368729 bytes
address size data func:line
ffff880067e9aa40 10 ZZZZZZZZZZ zfsdev_ioctl:5655
Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Closes #2262
Diffstat (limited to 'patches')
0 files changed, 0 insertions, 0 deletions