aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-10-07 07:00:33 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-10-14 12:47:35 -0400
commit40bbfd4c1b336b8841bef9933b6e09252ace56b8 (patch)
tree113aeddb212dba5d3db7b82d1d68f26a9e24f6e7 /drivers/net/wireless/iwlwifi
parent657e11a47dede79cae1d2f72084f6f7303aec725 (diff)
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>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 7079efbe34eb..c2636a7ab9ee 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -385,6 +385,8 @@ static unsigned int iwl_hw_get_beacon_cmd(struct iwl_priv *priv,
385 sizeof(frame->u) - sizeof(*tx_beacon_cmd)); 385 sizeof(frame->u) - sizeof(*tx_beacon_cmd));
386 if (WARN_ON_ONCE(frame_size > MAX_MPDU_SIZE)) 386 if (WARN_ON_ONCE(frame_size > MAX_MPDU_SIZE))
387 return 0; 387 return 0;
388 if (!frame_size)
389 return 0;
388 390
389 /* Set up TX command fields */ 391 /* Set up TX command fields */
390 tx_beacon_cmd->tx.len = cpu_to_le16((u16)frame_size); 392 tx_beacon_cmd->tx.len = cpu_to_le16((u16)frame_size);