summaryrefslogtreecommitdiff
path: root/drivers/staging/wilc1000
diff options
context:
space:
mode:
authorAjay Singh <ajay.kathat@microchip.com>2018-06-26 09:07:09 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-06-28 15:55:51 +0300
commite6ea187b5b2acff5ed07dacff37306d0f56d6d43 (patch)
treecfcbaccb39b832bde4d096371bb7a8850da9de28 /drivers/staging/wilc1000
parentc6a358d56476274c0ed4c4604565959692569762 (diff)
downloadlinux-e6ea187b5b2acff5ed07dacff37306d0f56d6d43.tar.xz
staging: wilc1000: handle freeing of key data in wep add key
Modified the code to free the allocated memory, used to store the key in wilc_add_wep_key_bss_sta() and wilc_add_wep_key_bss_ap(). After work completion notification is received, free the memory allocated to avoid missing of free in work function. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r--drivers/staging/wilc1000/host_interface.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 6d27a9dc246f..2cc968953ba0 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1551,8 +1551,6 @@ static void handle_key(struct work_struct *work)
memcpy(&key_buf[2], hif_key->attr.wep.key,
hif_key->attr.wep.key_len);
- kfree(hif_key->attr.wep.key);
-
wid_list[2].id = (u16)WID_WEP_KEY_VALUE;
wid_list[2].type = WID_STR;
wid_list[2].size = hif_key->attr.wep.key_len + 2;
@@ -1573,7 +1571,6 @@ static void handle_key(struct work_struct *work)
memcpy(key_buf + 1, &hif_key->attr.wep.key_len, 1);
memcpy(key_buf + 2, hif_key->attr.wep.key,
hif_key->attr.wep.key_len);
- kfree(hif_key->attr.wep.key);
wid.id = (u16)WID_ADD_WEP_KEY;
wid.type = WID_STR;
@@ -2629,8 +2626,6 @@ int wilc_add_wep_key_bss_sta(struct wilc_vif *vif, const u8 *key, u8 len,
goto free_key;
wait_for_completion(&msg->work_comp);
- kfree(msg);
- return 0;
free_key:
kfree(msg->body.key_info.attr.wep.key);
@@ -2674,8 +2669,6 @@ int wilc_add_wep_key_bss_ap(struct wilc_vif *vif, const u8 *key, u8 len,
goto free_key;
wait_for_completion(&msg->work_comp);
- kfree(msg);
- return 0;
free_key:
kfree(msg->body.key_info.attr.wep.key);