svn commit: r315778 - head/sys/dev/iwm
Adrian Chadd
adrian at FreeBSD.org
Thu Mar 23 04:34:26 UTC 2017
Author: adrian
Date: Thu Mar 23 04:34:25 2017
New Revision: 315778
URL: https://svnweb.freebsd.org/changeset/base/315778
Log:
[iwm] Move mbuf hacks after sanity checks in iwm_mvm_rx_rx_mpdu().
* This avoids leaving the mbuf in a weird state, when dropping a packet.
Obtained from: dragonflybsd.git 96eaecf93d9f731459a0df8efc72cfad034320bd
Modified:
head/sys/dev/iwm/if_iwm.c
Modified: head/sys/dev/iwm/if_iwm.c
==============================================================================
--- head/sys/dev/iwm/if_iwm.c Thu Mar 23 04:33:15 2017 (r315777)
+++ head/sys/dev/iwm/if_iwm.c Thu Mar 23 04:34:25 2017 (r315778)
@@ -3179,9 +3179,6 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc,
len = le16toh(rx_res->byte_count);
rx_pkt_status = le32toh(*(uint32_t *)(pkt->data + sizeof(*rx_res) + len));
- m->m_data = pkt->data + sizeof(*rx_res);
- m->m_pkthdr.len = m->m_len = len;
-
if (__predict_false(phy_info->cfg_phy_cnt > 20)) {
device_printf(sc->sc_dev,
"dsp size out of range [0,20]: %d\n",
@@ -3218,6 +3215,9 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc,
goto fail;
}
+ m->m_data = pkt->data + sizeof(*rx_res);
+ m->m_pkthdr.len = m->m_len = len;
+
IWM_DPRINTF(sc, IWM_DEBUG_RECV,
"%s: rssi=%d, noise=%d\n", __func__, rssi, sc->sc_noise);
More information about the svn-src-head
mailing list