Forráskód Böngészése

iwlagn: check beacon frame size

When the beacon_skb is NULL, we might still
attempt to use it in this code path (if we
ever get here) -- make the code a bit more
defensive and check the return value of
iwl_fill_beacon_frame() against zero.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Johannes Berg 14 éve
szülő
commit
40bbfd4c1b
1 módosított fájl, 2 hozzáadás és 0 törlés
  1. 2 0
      drivers/net/wireless/iwlwifi/iwl-agn.c

+ 2 - 0
drivers/net/wireless/iwlwifi/iwl-agn.c

@@ -385,6 +385,8 @@ static unsigned int iwl_hw_get_beacon_cmd(struct iwl_priv *priv,
 				sizeof(frame->u) - sizeof(*tx_beacon_cmd));
 	if (WARN_ON_ONCE(frame_size > MAX_MPDU_SIZE))
 		return 0;
+	if (!frame_size)
+		return 0;
 
 	/* Set up TX command fields */
 	tx_beacon_cmd->tx.len = cpu_to_le16((u16)frame_size);