mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +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
1 changed files with 3 additions and 0 deletions
|
@ -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 a new issue