mm/damon/reclaim: avoid divide-by-zero in damon_reclaim_apply_parameters()
commit e6b543ca upstream. When creating a new scheme of DAMON_RECLAIM, the calculation of 'min_age_region' uses 'aggr_interval' as the divisor, which may lead to division-by-zero errors. Fix it by directly returning -EINVAL when such a case occurs. Link: https://lkml.kernel.org/r/20250827115858.1186261-3-yanquanmin1@huawei.com Fixes: f5a79d7c ("mm/damon: introduce struct damos_access_pattern") Signed-off-by:Quanmin Yan <yanquanmin1@huawei.com> Reviewed-by:
SeongJae Park <sj@kernel.org> Cc: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: ze zuo <zuoze1@huawei.com> Cc: <stable@vger.kernel.org> [6.1+] Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
SeongJae Park <sj@kernel.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Loading