mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
bcachefs: Fix undefined behaviour
roundup_pow_of_two(0) is undefined Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
ab9ff73322
commit
618b9e575b
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user