copy: safeguard allocation problems

This commit is contained in:
Thomas Schoebel-Theuer 2022-02-23 08:30:20 +01:00 committed by Thomas Schoebel-Theuer
parent 49c408cac2
commit 7caf2341ea
1 changed files with 3 additions and 0 deletions

View File

@ -1373,6 +1373,9 @@ static int copy_brick_construct(struct copy_brick *brick)
void **st;
unsigned i;
if (unlikely(brick->st)) {
MARS_ERR("Re-initialize state table\n");
}
st = brick_block_alloc(0, PAGE_SIZE);
memset(st, 0, PAGE_SIZE);