diff options
author | Damien George <damien.p.george@gmail.com> | 2020-01-31 20:46:35 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-01-31 20:46:35 +1100 |
commit | d494e478556579d3b963b1b05ece208b67fa380a (patch) | |
tree | 9cdc7218d685e205ba1ad464a012fea9a0325308 | |
parent | 5de55e8fb441ba80a4c59a6dbf1bf8978b82eae5 (diff) |
drivers/cyw43: Return early from cyw43_wifi_set_up if wifi_on fails.
-rw-r--r-- | drivers/cyw43/cyw43_ctrl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/cyw43/cyw43_ctrl.c b/drivers/cyw43/cyw43_ctrl.c index efd750e63..cc1fbecde 100644 --- a/drivers/cyw43/cyw43_ctrl.c +++ b/drivers/cyw43/cyw43_ctrl.c @@ -456,7 +456,9 @@ void cyw43_wifi_set_up(cyw43_t *self, int itf, bool up) { } else { country = MAKE_COUNTRY(pyb_country_code[0], pyb_country_code[1], 0); } - cyw43_wifi_on(self, country); + if (cyw43_wifi_on(self, country) != 0) { + return; + } cyw43_wifi_pm(self, 10 << 20 | 1 << 16 | 1 << 12 | 20 << 4 | 2); } if (itf == CYW43_ITF_AP) { |