diff options
author | peterj <peterj@FreeBSD.org> | 2014-12-28 07:14:38 +0000 |
---|---|---|
committer | peterj <peterj@FreeBSD.org> | 2014-12-28 07:14:38 +0000 |
commit | f7c5de75b0141381ea7318b5c36ba41e0350f690 (patch) | |
tree | 42d2a0bc27a2680f94cca2d7fae63bbf4182a4ad /sys/fs | |
parent | 85cae5d907dce32e2e7cab66acb1d199238ff3b6 (diff) | |
download | FreeBSD-src-f7c5de75b0141381ea7318b5c36ba41e0350f690.zip FreeBSD-src-f7c5de75b0141381ea7318b5c36ba41e0350f690.tar.gz |
MFH r275941:
Adjust the test of a KASSERT to better match the intent.
This assertion was added in r246213 as a guard against corrupted mbufs
arriving from drivers, the key distinguishing factor of said mbufs being
that they had a negative length. Given we're in a while loop specifically
designed to skip over zero-length mbufs, panicking on a zero-length mbuf
seems incorrect.
Suggested by: rmacklem
MFH go-ahead: benno
Approved by: grog (co-mentor)
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/nfs/nfs_commonsubs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index b94091c..6e0204b8 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -219,7 +219,8 @@ nfsm_mbufuio(struct nfsrv_descript *nd, struct uio *uiop, int siz) } mbufcp = NFSMTOD(mp, caddr_t); len = mbuf_len(mp); - KASSERT(len > 0, ("len %d", len)); + KASSERT(len >= 0, + ("len %d, corrupted mbuf?", len)); } xfer = (left > len) ? len : left; #ifdef notdef |