Commit b0f1836f authored by Leo Kim's avatar Leo Kim Committed by Greg Kroah-Hartman

staging: wilc1000: adds a check routine when performed del_key()

This patch is adds a check routine when performed del_key().
We was find this situation while test the 'rmmod sdio'.
That is received inform a .del_key cmd from cfg80211.
If is not exist wep keys, must be ignore a wilc_remove_wep_key() function.
Thus, adds a check routine that key length of wep.
Signed-off-by: default avatarLeo Kim <leo.kim@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8006109b
...@@ -1122,9 +1122,12 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev, ...@@ -1122,9 +1122,12 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
} }
if (key_index >= 0 && key_index <= 3) { if (key_index >= 0 && key_index <= 3) {
memset(priv->WILC_WFI_wep_key[key_index], 0, priv->WILC_WFI_wep_key_len[key_index]); if (priv->WILC_WFI_wep_key_len[key_index]) {
priv->WILC_WFI_wep_key_len[key_index] = 0; memset(priv->WILC_WFI_wep_key[key_index], 0,
wilc_remove_wep_key(vif, key_index); priv->WILC_WFI_wep_key_len[key_index]);
priv->WILC_WFI_wep_key_len[key_index] = 0;
wilc_remove_wep_key(vif, key_index);
}
} else { } else {
wilc_remove_key(priv->hif_drv, mac_addr); wilc_remove_key(priv->hif_drv, mac_addr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment