iwmc3200wifi: fix NULL pointer dereference in pmkid update

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>
This commit is contained in:
Zhu Yi 2009-12-01 11:48:50 +08:00 коммит произвёл John W. Linville
Родитель 914828fad0
Коммит 6646a664e3
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -970,7 +970,9 @@ int iwm_send_pmkid_update(struct iwm_priv *iwm,
memset(&update, 0, sizeof(struct iwm_umac_pmkid_update)); memset(&update, 0, sizeof(struct iwm_umac_pmkid_update));
update.command = cpu_to_le32(command); update.command = cpu_to_le32(command);
if (pmksa->bssid)
memcpy(&update.bssid, pmksa->bssid, ETH_ALEN); memcpy(&update.bssid, pmksa->bssid, ETH_ALEN);
if (pmksa->pmkid)
memcpy(&update.pmkid, pmksa->pmkid, WLAN_PMKID_LEN); memcpy(&update.pmkid, pmksa->pmkid, WLAN_PMKID_LEN);
ret = iwm_send_wifi_if_cmd(iwm, &update, ret = iwm_send_wifi_if_cmd(iwm, &update,