diff options
Diffstat (limited to 'samples')
| -rw-r--r-- | samples/damon/mtier.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/samples/damon/mtier.c b/samples/damon/mtier.c index dab8fb10b617..3dae16fd2e11 100644 --- a/samples/damon/mtier.c +++ b/samples/damon/mtier.c @@ -153,6 +153,9 @@ static struct damon_ctx *damon_sample_mtier_build_ctx(bool promote) if (!scheme) goto free_out; damon_set_schemes(ctx, &scheme, 1); + /* zero target value causes division by zero in damos_quota_store() */ + if (!node0_mem_used_bp || !node0_mem_free_bp) + goto free_out; quota_goal = damos_new_quota_goal( promote ? DAMOS_QUOTA_NODE_MEM_USED_BP : DAMOS_QUOTA_NODE_MEM_FREE_BP, |
