3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00

wired: check eap_load_settings

Caught by static analysis
This commit is contained in:
James Prestwood 2022-03-18 09:44:18 -07:00 committed by Denis Kenzior
parent 9f6576be05
commit 78301ec9cb

View File

@ -238,10 +238,15 @@ static void rx_packet(struct ethdev *dev, const uint8_t *addr,
l_debug("Created new EAPoL session");
l_queue_push_tail(dev->eapol_sessions, eapol);
eapol->cred = network_lookup_security("default");
eap_load_settings(eapol->eap, eapol->cred, "EAP-");
if (!eapol->cred || !eap_load_settings(eapol->eap,
eapol->cred, "EAP-")) {
l_error("Failed to load EAP settings");
eapol_free(eapol);
return;
}
l_queue_push_tail(dev->eapol_sessions, eapol);
eap_set_key_material_func(eapol->eap, eap_key_material);
eap_set_event_func(eapol->eap, eap_event);