diff options
author | Dennis Jeon <dennis.jeon@broadcom.com> | 2022-06-15 11:56:31 +0900 |
---|---|---|
committer | Roger Wang <wangroger@google.com> | 2022-06-15 23:10:56 +0800 |
commit | e784a9cf59203c900f68352c691675aea46ca015 (patch) | |
tree | d66582493f878e195b3ef8e18a755119062f1a44 | |
parent | 863d5f9c661cfe64b6ec0e5880f12fd2049b3940 (diff) | |
download | wlan-e784a9cf59203c900f68352c691675aea46ca015.tar.gz |
HAL: Fixed to propagate error when pre-init fails
In case of pre-init failure, HAL damon can be crashes by CHECK macro if the subsequent process is performed.
It should be returned error code and induce retry.
Bug: 235041267
Test: Basic function works fine
Signed-off-by: Dennis Jeon <dennis.jeon@broadcom.com>
Change-Id: I2f33e0ebb9d1f8717284965ac1581c28443c7c2e
-rwxr-xr-x | bcmdhd/wifi_hal/wifi_hal.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bcmdhd/wifi_hal/wifi_hal.cpp b/bcmdhd/wifi_hal/wifi_hal.cpp index 82974bd..9a5394c 100755 --- a/bcmdhd/wifi_hal/wifi_hal.cpp +++ b/bcmdhd/wifi_hal/wifi_hal.cpp @@ -565,12 +565,13 @@ wifi_error wifi_wait_for_driver_ready(void) // Function times out after 10 seconds int count = (POLL_DRIVER_MAX_TIME_MS * 1000) / POLL_DRIVER_DURATION_US; FILE *fd; + wifi_error status = WIFI_SUCCESS; do { if ((fd = fopen("/sys/class/net/wlan0", "r")) != NULL) { fclose(fd); - wifi_pre_initialize(); - return WIFI_SUCCESS; + status = wifi_pre_initialize(); + return status; } usleep(POLL_DRIVER_DURATION_US); } while(--count > 0); |