From 0db1b84a6df462cee40f9eab24ac4489c654fa51 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Wed, 2 Sep 2020 19:30:29 +0300 Subject: [PATCH] zvol: unsigned off can not be less than zero Reviewed-by: Richard Elling Reviewed-by: Brian Behlendorf Reviewed-by: Ryan Moeller Signed-off-by: Toomas Soome Closes #10867 --- module/os/freebsd/zfs/zvol_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/os/freebsd/zfs/zvol_os.c b/module/os/freebsd/zfs/zvol_os.c index 19018be3b1..ecef075f9e 100644 --- a/module/os/freebsd/zfs/zvol_os.c +++ b/module/os/freebsd/zfs/zvol_os.c @@ -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; }