Roman Smirnov b0cb5564c3 block: prevent division by zero in blk_rq_stat_sum()
[ Upstream commit 93f52fbeaf4b676b21acfe42a5152620e6770d02 ]

The expression dst->nr_samples + src->nr_samples may
have zero value on overflow. It is necessary to add
a check to avoid division by zero.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Signed-off-by: Roman Smirnov <r.smirnov@omp.ru>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/20240305134509.23108-1-r.smirnov@omp.ru
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 12:59:49 +02:00
..
2020-08-18 07:48:08 -07:00
2020-10-13 12:12:44 -07:00
2020-03-17 20:55:21 +01:00
2020-09-23 09:18:13 -06:00
2020-10-13 13:04:41 -07:00
2020-01-06 20:59:04 -07:00