summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorpho <pho@FreeBSD.org>2012-03-09 17:19:50 +0000
committerpho <pho@FreeBSD.org>2012-03-09 17:19:50 +0000
commitaae0696a6a0a090a1fb535b3b6156c13cc6b272b (patch)
tree9ee7976c9e06403a0f18f905db4ccd2a3a3d5550 /sys/ufs
parentbeb3f0289d04fd667addc616aff5bc478063cc6c (diff)
downloadFreeBSD-src-aae0696a6a0a090a1fb535b3b6156c13cc6b272b.zip
FreeBSD-src-aae0696a6a0a090a1fb535b3b6156c13cc6b272b.tar.gz
Revert r232692 as the correct place to fix this is at the syscall level.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_vnops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 5535855..9e8648e 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -464,11 +464,11 @@ ffs_read(ap)
} else if (vp->v_type != VREG && vp->v_type != VDIR)
panic("ffs_read: type %d", vp->v_type);
#endif
- if (uio->uio_resid < 0 || uio->uio_offset < 0)
- return (EINVAL);
orig_resid = uio->uio_resid;
+ KASSERT(orig_resid >= 0, ("ffs_read: uio->uio_resid < 0"));
if (orig_resid == 0)
return (0);
+ KASSERT(uio->uio_offset >= 0, ("ffs_read: uio->uio_offset < 0"));
fs = ip->i_fs;
if (uio->uio_offset < ip->i_size &&
uio->uio_offset >= fs->fs_maxfilesize)
OpenPOWER on IntegriCloud