diff options
author | Leo Kim <leo.kim@atmel.com> | 2016-04-01 17:44:19 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-28 21:58:42 -0700 |
commit | b0f1836fadc89dd5629021cfc4ab72ef9f2bfcb3 (patch) | |
tree | ad0c69e438dc70ebb1681b454d83ef7a438bc3ee /drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | |
parent | 8006109ba0f9b85407ce41c86e7a9a059d08b90c (diff) | |
download | linux-b0f1836fadc89dd5629021cfc4ab72ef9f2bfcb3.tar.gz linux-b0f1836fadc89dd5629021cfc4ab72ef9f2bfcb3.tar.xz |
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: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000/wilc_wfi_cfgoperations.c')
-rw-r--r-- | drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 1ac835becc9d..85031f75d7ee 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1122,9 +1122,12 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev, } if (key_index >= 0 && key_index <= 3) { - memset(priv->WILC_WFI_wep_key[key_index], 0, priv->WILC_WFI_wep_key_len[key_index]); - priv->WILC_WFI_wep_key_len[key_index] = 0; - wilc_remove_wep_key(vif, key_index); + if (priv->WILC_WFI_wep_key_len[key_index]) { + memset(priv->WILC_WFI_wep_key[key_index], 0, + 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 { wilc_remove_key(priv->hif_drv, mac_addr); } |