From 7caf2341ea7101949dd6b81627fc558d0f65831e Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Wed, 23 Feb 2022 08:30:20 +0100 Subject: [PATCH] copy: safeguard allocation problems --- kernel/mars_copy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/mars_copy.c b/kernel/mars_copy.c index 618f78fb..2d0f0650 100644 --- a/kernel/mars_copy.c +++ b/kernel/mars_copy.c @@ -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);