3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 21:22:37 +01:00

ap: massage code to make static analysis happy

There is no functional change here but checking the return
value makes static analysis much happier. Checking the
return and setting the default inside the if clause is also
consistent with how IWD does it many other places.
This commit is contained in:
James Prestwood 2021-02-08 12:19:58 -08:00 committed by Denis Kenzior
parent 0ae3e1c59d
commit f046bed225

View File

@ -3305,7 +3305,7 @@ static void ap_netdev_watch(struct netdev *netdev,
static int ap_init(void) static int ap_init(void)
{ {
const struct l_settings *settings = iwd_get_config(); const struct l_settings *settings = iwd_get_config();
bool dhcp_enable = false; bool dhcp_enable;
netdev_watch = netdev_watch_add(ap_netdev_watch, NULL, NULL); netdev_watch = netdev_watch_add(ap_netdev_watch, NULL, NULL);
@ -3320,8 +3320,9 @@ static int ap_init(void)
* DHCP server. If no value is found or it is false do not create a * DHCP server. If no value is found or it is false do not create a
* DHCP server. * DHCP server.
*/ */
l_settings_get_bool(settings, "General", "EnableNetworkConfiguration", if (!l_settings_get_bool(settings, "General",
&dhcp_enable); "EnableNetworkConfiguration", &dhcp_enable))
dhcp_enable = false;
if (dhcp_enable) { if (dhcp_enable) {
L_AUTO_FREE_VAR(char *, ip_prefix); L_AUTO_FREE_VAR(char *, ip_prefix);