Skip to content
Commit 93f52fbe authored by Roman Smirnov's avatar Roman Smirnov Committed by Jens Axboe
Browse files

block: prevent division by zero in blk_rq_stat_sum()



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: default avatarRoman Smirnov <r.smirnov@omp.ru>
Reviewed-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/20240305134509.23108-1-r.smirnov@omp.ru
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent e6dfe748
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment