Skip to content

Commit

Permalink
iwmc3200wifi: fix NULL pointer dereference in pmkid update
Browse files Browse the repository at this point in the history
When handling IWM_CMD_PMKID_FLUSH command, the bssid and
pmkid in pmksa are all NULL. Check it before memcpy.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Zhu Yi authored and John W. Linville committed Dec 4, 2009
1 parent 914828f commit 6646a66
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/wireless/iwmc3200wifi/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,8 +970,10 @@ int iwm_send_pmkid_update(struct iwm_priv *iwm,
memset(&update, 0, sizeof(struct iwm_umac_pmkid_update));

update.command = cpu_to_le32(command);
memcpy(&update.bssid, pmksa->bssid, ETH_ALEN);
memcpy(&update.pmkid, pmksa->pmkid, WLAN_PMKID_LEN);
if (pmksa->bssid)
memcpy(&update.bssid, pmksa->bssid, ETH_ALEN);
if (pmksa->pmkid)
memcpy(&update.pmkid, pmksa->pmkid, WLAN_PMKID_LEN);

ret = iwm_send_wifi_if_cmd(iwm, &update,
sizeof(struct iwm_umac_pmkid_update), 0);
Expand Down

0 comments on commit 6646a66

Please sign in to comment.