summaryrefslogtreecommitdiff
path: root/libbcachefs/ec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/ec.c')
-rw-r--r--libbcachefs/ec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libbcachefs/ec.c b/libbcachefs/ec.c
index 05b680c9..740d3ef7 100644
--- a/libbcachefs/ec.c
+++ b/libbcachefs/ec.c
@@ -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))