mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-29 05:39:24 +01:00
netdev: free SAE SM once protocol has completed
SAE was behaving inconsitently with respect to freeing the state. It was freeing the SM internally on failure, but requiring netdev free it on success. This removes the call to sae_sm_free in sae.c upon failure, and instead netdev frees the SM in the complete callback in all cases regardless of success or failure.
This commit is contained in:
parent
ea571bc6ac
commit
e7219cbcc5
@ -2577,10 +2577,12 @@ static void netdev_sae_complete(uint16_t status, void *user_data)
|
|||||||
struct iovec iov[3];
|
struct iovec iov[3];
|
||||||
int iov_elems = 0;
|
int iov_elems = 0;
|
||||||
|
|
||||||
|
sae_sm_free(netdev->sae_sm);
|
||||||
|
netdev->sae_sm = NULL;
|
||||||
|
|
||||||
if (status != 0) {
|
if (status != 0) {
|
||||||
l_error("SAE exchange failed on %u result %u",
|
l_error("SAE exchange failed on %u result %u",
|
||||||
netdev->index, status);
|
netdev->index, status);
|
||||||
netdev->sae_sm = NULL;
|
|
||||||
goto auth_failed;
|
goto auth_failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,8 +157,6 @@ static bool sae_cn(const uint8_t *kck, uint16_t send_confirm,
|
|||||||
static void sae_authentication_failed(struct sae_sm *sm, uint16_t reason)
|
static void sae_authentication_failed(struct sae_sm *sm, uint16_t reason)
|
||||||
{
|
{
|
||||||
sm->complete(reason, sm->user_data);
|
sm->complete(reason, sm->user_data);
|
||||||
|
|
||||||
sae_sm_free(sm);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sae_reject_authentication(struct sae_sm *sm, uint16_t reason)
|
static void sae_reject_authentication(struct sae_sm *sm, uint16_t reason)
|
||||||
|
Loading…
Reference in New Issue
Block a user