Use 'sizeof(data)' rather than '4' when checking an mbuf bound, as is the

case for adjusting length/etc.
This commit is contained in:
Robert N. M. Watson 2014-07-21 20:33:54 +00:00
parent 0a18924f45
commit 20b39086cc

View file

@ -1234,7 +1234,8 @@ atse_rx_locked(struct atse_softc *sc)
data = ATSE_RX_DATA_READ(sc);
#endif
/* Make sure to not overflow the mbuf data size. */
if (sc->atse_rx_buf_len >= sc->atse_rx_m->m_len - 4) {
if (sc->atse_rx_buf_len >= sc->atse_rx_m->m_len -
sizeof(data)) {
/*
* XXX-BZ Error. We need more mbufs and are
* not setup for this yet.