len = iwl_rx_packet_len(pkt);
len += sizeof(u32); /* account for status word */
+
+ offset += ALIGN(len, FH_RSCSR_FRAME_ALIGN);
+
+ /* check that what the device tells us made sense */
+ if (offset > max_len)
+ break;
+
trace_iwlwifi_dev_rx(trans->dev, trans, pkt, len);
trace_iwlwifi_dev_rx_data(trans->dev, trans, pkt, len);
page_stolen |= rxcb._page_stolen;
if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)
break;
- offset += ALIGN(len, FH_RSCSR_FRAME_ALIGN);
}
/* page was stolen from us -- free our reference */