mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-05-10 18:58:27 +03:00
Free memory in an error path in spl-kmem-cache.c
skc->skc_name also needs to be freed in an error path. Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Vandana Rungta <vrungta@amazon.com> Closes #17041
This commit is contained in:
parent
8487b6c9b4
commit
c4fa9c2962
@ -727,6 +727,7 @@ spl_kmem_cache_create(const char *name, size_t size, size_t align,
|
|||||||
|
|
||||||
rc = percpu_counter_init(&skc->skc_linux_alloc, 0, GFP_KERNEL);
|
rc = percpu_counter_init(&skc->skc_linux_alloc, 0, GFP_KERNEL);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
|
kfree(skc->skc_name);
|
||||||
kfree(skc);
|
kfree(skc);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user