zvol: unsigned off can not be less than zero

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Toomas Soome <tsoome@me.com>
Closes #10867
This commit is contained in:
Toomas Soome 2020-09-02 19:30:29 +03:00 committed by Brian Behlendorf
parent 7c36a9e24a
commit ef8a6fe9fe
1 changed files with 1 additions and 1 deletions

View File

@ -626,7 +626,7 @@ zvol_geom_bio_strategy(struct bio *bp)
addr = bp->bio_data;
resid = bp->bio_length;
if (resid > 0 && (off < 0 || off >= volsize)) {
if (resid > 0 && off >= volsize) {
error = SET_ERROR(EIO);
goto resume;
}