Commit 5b9be671 authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: handle freeing of key data in wilc_add_ptk()

Handle freeing of memory allocated to store the 'key' in wilc_add_ptk()
function. Once work completion notification is received, free the
memory allocated to avoid missing of free in work function sepecially
for error scenario.
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Reviewed-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e6ea187b
......@@ -1724,7 +1724,6 @@ static void handle_key(struct work_struct *work)
out_wpa_ptk:
complete(&msg->work_comp);
kfree(hif_key->attr.wpa.key);
break;
case PMKSA:
......@@ -2735,8 +2734,6 @@ int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len,
}
wait_for_completion(&msg->work_comp);
kfree(msg);
return 0;
free_key:
kfree(msg->body.key_info.attr.wpa.key);
......
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