Skip to content

Commit

Permalink
Free memory in an error path in spl-kmem-cache.c
Browse files Browse the repository at this point in the history
skc->skc_name also needs to be freed in an error path.

Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Tino Reichardt <[email protected]>
Signed-off-by: Vandana Rungta <[email protected]>
Closes #17041
  • Loading branch information
vandanarungta authored Feb 12, 2025
1 parent b901d4a commit db62886
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions module/os/linux/spl/spl-kmem-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
if (rc != 0) {
kfree(skc->skc_name);
kfree(skc);
return (NULL);
}
Expand Down

0 comments on commit db62886

Please sign in to comment.