]> www.infradead.org Git - nvme.git/commit
bcachefs: fix the memory leak in exception case
authorHongbo Li <lihongbo22@huawei.com>
Tue, 24 Sep 2024 01:41:46 +0000 (09:41 +0800)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 28 Sep 2024 01:46:34 +0000 (21:46 -0400)
commitdc5bfdf8eaed76cf527c9477952c535f75e0e499
tree64891dd7cd5ecc37f1414ac39861fd7c00619297
parent3125c95ea69141c4cbbde854674c90531034ec47
bcachefs: fix the memory leak in exception case

The pointer clean points the memory allocated by kmemdup, when the
return value of bch2_sb_clean_validate_late is not zero. The memory
pointed by clean is leaked. So we should free it in this case.

Fixes: a37ad1a3aba9 ("bcachefs: sb-clean.c")
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/sb-clean.c