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: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
out_wpa_ptk:
complete(&msg->work_comp);
- kfree(hif_key->attr.wpa.key);
break;
case PMKSA:
}
wait_for_completion(&msg->work_comp);
- kfree(msg);
- return 0;
free_key:
kfree(msg->body.key_info.attr.wpa.key);