From f7a9caef2b084b47c2b808f24eadbf2d33d734d5 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Thu, 14 Dec 2017 14:26:17 -0800 Subject: [PATCH] simauth: remove unregister API The unregister simauth API was unused and not required, this also fixes a double free when freeing the NAI. --- src/simauth.c | 24 +++++++----------------- src/simauth.h | 2 -- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/simauth.c b/src/simauth.c index 2c0bccd5..698d44df 100644 --- a/src/simauth.c +++ b/src/simauth.c @@ -73,22 +73,6 @@ bool iwd_sim_auth_register(struct iwd_sim_auth *auth) return l_queue_push_head(auth_providers, auth); } -void iwd_sim_auth_unregister(struct iwd_sim_auth *auth) -{ - if (auth->driver->cancel_request) - auth->driver->cancel_request(auth, auth->pending); - - WATCHLIST_NOTIFY_NO_ARGS(&auth->auth_watchers, - sim_auth_unregistered_cb_t); - - l_free(auth->nai); - - auth->aka_supported = false; - auth->sim_supported = false; - - l_queue_remove(auth_providers, auth); -} - void *iwd_sim_auth_get_data(struct iwd_sim_auth *auth) { return auth->driver_data; @@ -109,7 +93,13 @@ static void destroy_provider(void *data) void iwd_sim_auth_remove(struct iwd_sim_auth *auth) { - iwd_sim_auth_unregister(auth); + if (auth->driver->cancel_request) + auth->driver->cancel_request(auth, auth->pending); + + WATCHLIST_NOTIFY_NO_ARGS(&auth->auth_watchers, + sim_auth_unregistered_cb_t); + + l_queue_remove(auth_providers, auth); destroy_provider(auth); } diff --git a/src/simauth.h b/src/simauth.h index 6ffb049a..441a6636 100644 --- a/src/simauth.h +++ b/src/simauth.h @@ -95,8 +95,6 @@ void iwd_sim_auth_set_data(struct iwd_sim_auth *auth, void *driver_data); bool iwd_sim_auth_register(struct iwd_sim_auth *auth); -void iwd_sim_auth_unregister(struct iwd_sim_auth *auth); - void *iwd_sim_auth_get_data(struct iwd_sim_auth *auth); void iwd_sim_auth_remove(struct iwd_sim_auth *auth);