Skip to content

Commit

Permalink
iwlwifi: check scan request ie_len
Browse files Browse the repository at this point in the history
In mac80211 we always check both scan_req->ie and scan_req->ie_len
against zero before usage, in iwlwifi we should do the same.

Remove not needed "left -= ie_len" while at it.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Stanislaw Gruszka authored and John W. Linville committed Apr 16, 2010
1 parent a02a295 commit eb2ec0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/wireless/iwlwifi/iwl-scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,10 +644,10 @@ u16 iwl_fill_probe_req(struct iwl_priv *priv, struct ieee80211_mgmt *frame,
if (WARN_ON(left < ie_len))
return len;

if (ies)
if (ies && ie_len) {
memcpy(pos, ies, ie_len);
len += ie_len;
left -= ie_len;
len += ie_len;
}

return (u16)len;
}
Expand Down

0 comments on commit eb2ec0f

Please sign in to comment.