Move wpa_scan_results_free() into shared C file
Replace the inline helper function with a new C file that can be used for common driver API related function. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
a4cef16279
commit
aea855d752
10 changed files with 53 additions and 13 deletions
|
@ -3492,17 +3492,7 @@ static inline void drv_event_eapol_rx(void *ctx, const u8 *src, const u8 *data,
|
|||
wpa_supplicant_event(ctx, EVENT_EAPOL_RX, &event);
|
||||
}
|
||||
|
||||
static inline void wpa_scan_results_free(struct wpa_scan_results *res)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (res == NULL)
|
||||
return;
|
||||
|
||||
for (i = 0; i < res->num; i++)
|
||||
os_free(res->res[i]);
|
||||
os_free(res->res);
|
||||
os_free(res);
|
||||
}
|
||||
/* driver_common.c */
|
||||
void wpa_scan_results_free(struct wpa_scan_results *res);
|
||||
|
||||
#endif /* DRIVER_H */
|
||||
|
|
30
src/drivers/driver_common.c
Normal file
30
src/drivers/driver_common.c
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Common driver-related functions
|
||||
* Copyright (c) 2003-2011, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*
|
||||
* See README and COPYING for more details.
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "utils/common.h"
|
||||
#include "driver.h"
|
||||
|
||||
void wpa_scan_results_free(struct wpa_scan_results *res)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (res == NULL)
|
||||
return;
|
||||
|
||||
for (i = 0; i < res->num; i++)
|
||||
os_free(res->res[i]);
|
||||
os_free(res->res);
|
||||
os_free(res);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue