Skip to content

Commit

Permalink
zvol: unsigned off can not be less than zero
Browse files Browse the repository at this point in the history
Reviewed-by: Richard Elling <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Toomas Soome <[email protected]>
Closes openzfs#10867
  • Loading branch information
tsoome authored and RageLtMan committed May 31, 2021
1 parent d74b1df commit 26dea15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/os/freebsd/zfs/zvol_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 26dea15

Please sign in to comment.