Commit 618b9e57 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix undefined behaviour

roundup_pow_of_two(0) is undefined
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent ab9ff733
......@@ -1351,6 +1351,9 @@ int bch2_ec_mem_alloc(struct bch_fs *c, bool gc)
if (ret)
return ret;
if (!idx)
return 0;
if (!gc &&
!init_heap(&c->ec_stripes_heap, roundup_pow_of_two(idx),
GFP_KERNEL))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment