Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56b408e5 authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman
Browse files

staging: wilc1000: handle freeing of 'key' & 'seq' data in wilc_add_rx_gtk()



Handle freeing of memory allocated to keep 'key' & 'seq' in wilc_add_rx_gtk().
Once completion event is received, free the memory allocated for
to avoid missing of free in work function.

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 5b9be671
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -1667,8 +1667,6 @@ static void handle_key(struct work_struct *work)
		}
out_wpa_rx_gtk:
		complete(&msg->work_comp);
		kfree(hif_key->attr.wpa.key);
		kfree(hif_key->attr.wpa.seq);
		break;

	case WPA_PTK:
@@ -2812,8 +2810,6 @@ int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len,
	}

	wait_for_completion(&msg->work_comp);
	kfree(msg);
	return 0;

free_key:
	kfree(msg->body.key_info.attr.wpa.key);