diff options
| author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2012-09-28 16:23:01 +0000 |
|---|---|---|
| committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2012-09-28 16:23:01 +0000 |
| commit | 2196d98ea09e3deb53af59acbf7cbaccc561a15b (patch) | |
| tree | cb15b429d6054f469b4f27f091a026c7dc18c520 /sys/dev | |
| parent | 66249c7c82f64f70b1cc7c7df5cf5cbadcd35ab8 (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/usb/net/if_smsc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/usb/net/if_smsc.c b/sys/dev/usb/net/if_smsc.c index 5f2acfbad2c7f..07874efb460fb 100644 --- a/sys/dev/usb/net/if_smsc.c +++ b/sys/dev/usb/net/if_smsc.c @@ -1043,8 +1043,11 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) /* Finally enqueue the mbuf on the receive queue */ /* Remove 4 trailing bytes */ - if (pktlen >= (4 + ETHER_HDR_LEN)) - uether_rxmbuf(ue, m, pktlen - 4); + if (pktlen < (4 + ETHER_HDR_LEN)) { + m_freem(m); + goto tr_setup; + } + uether_rxmbuf(ue, m, pktlen - 4); } /* Update the offset to move to the next potential packet */ |
