hostapd: make acs_init() fail when with invalid channels for VTS

At VTS test : VtsHalWifiHostapdV1_1Target, there is a sub-item:
  AddPskAccessPointWithAcsAndInvalidChannelRage
which sets invalid channel list, 222-999, and the test expects
it returns not success.

Before patch, hostapd didn't check if the channel is valid or not
in the interface initialization, until ACS scans and computes, then
show
   ACS: Failed to compute ideal channel
It makes the initiailzation still success, not as the VTS expected.

Thus, check if there are any available channels in acs_request_scan(),
and return -1 if no available channel, then it will fail at acs_init()
when in interface initialization, before doing ACS computation.
It shows
    Could not select hw_mode and channel. (-3)
    wlan0: interface state UNINITIALIZED->DISABLED
Then this VTS test can get the result, not success, as expected.

This patch has been commited to the Linux Hostapd stream
https://w1.fi/cgit/hostapd/commit/?id=d9286d099797186eb30870323da529c0284197bd

Test: Local

Change-Id: I03b210f1c12a2fe6291115c11e9241b23d47e93c
Signed-off-by: Neo Jou <neojou@gmail.com>
diff --git a/src/ap/acs.c b/src/ap/acs.c
index 3b45075..ca3b4e1 100644
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
@@ -942,6 +942,12 @@
 	}
 	*freq = 0;
 
+	if (params.freqs == freq) {
+		wpa_printf(MSG_ERROR, "ACS: No available channels found");
+		os_free(params.freqs);
+		return -1;
+	}
+
 	iface->scan_cb = acs_scan_complete;
 
 	wpa_printf(MSG_DEBUG, "ACS: Scanning %d / %d",