mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 13:02:44 +01:00
station: Fix memory leak
Make sure that the known frequency set is always cleaned up on error.
Fixes: bb604b92f1
("station: fallback to periodic scan if regdom unset")
This commit is contained in:
parent
82f873a025
commit
3d691038bc
@ -1354,7 +1354,7 @@ static void station_quick_scan_destroy(void *userdata)
|
||||
|
||||
static int station_quick_scan_trigger(struct station *station)
|
||||
{
|
||||
struct scan_freq_set *known_freq_set;
|
||||
_auto_(scan_freq_set_free) struct scan_freq_set *known_freq_set = NULL;
|
||||
bool known_6ghz;
|
||||
const struct scan_freq_set *disabled = wiphy_get_disabled_freqs(
|
||||
station->wiphy);
|
||||
@ -1385,7 +1385,6 @@ static int station_quick_scan_trigger(struct station *station)
|
||||
return -ENOTSUP;
|
||||
|
||||
if (!wiphy_constrain_freq_set(station->wiphy, known_freq_set)) {
|
||||
scan_freq_set_free(known_freq_set);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
@ -1394,8 +1393,6 @@ static int station_quick_scan_trigger(struct station *station)
|
||||
station_quick_scan_triggered,
|
||||
station_quick_scan_results,
|
||||
station_quick_scan_destroy);
|
||||
scan_freq_set_free(known_freq_set);
|
||||
|
||||
if (!station->quick_scan_id)
|
||||
return -EIO;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user