summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Mendez Hernandez <pablomh@gmail.com>2020-12-17 10:13:41 +0100
committerPablo Mendez Hernandez <pablomh@gmail.com>2020-12-17 12:01:59 +0100
commitc889ca2c5503fb955f276c4899924c324effd8cc (patch)
tree7a885e989997adbc88d2c6e61b600057c420a523
parent32fa4f2dc54fb601c117c23fd43c20abe38a6646 (diff)
downloadwlan-c889ca2c5503fb955f276c4899924c324effd8cc.tar.gz
wifi_hal: Fix access check of control param file
Currently, the driver control param file is created write-only, so fix the check: https://android.googlesource.com/kernel/msm-modules/qcacld/+/refs/heads/android-msm-coral-4.14-android11-qpr1/core/hdd/src/wlan_hdd_main.c#190 More importantly the open below uses O_WRONLY as only a write is necessary, there is no need to check for read access. Otherwise, WiFi fails to be enabled: WifiHAL : Failed to access driver state control param Permission denied, 13 at /sys/kernel/boot_wlan/boot_wlan Fixes: 8996467be9 ("wifihal: Update driver control param to check driver is ready") Test: Manual build and functionality test Signed-off-by: Pablo Mendez Hernandez <pablomh@gmail.com> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> Change-Id: If6308cd790c69d2d57815ef6815c779258005eff
-rw-r--r--qcwcn/wifi_hal/wifi_hal.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qcwcn/wifi_hal/wifi_hal.cpp b/qcwcn/wifi_hal/wifi_hal.cpp
index 6ab0e64..d64e3b8 100644
--- a/qcwcn/wifi_hal/wifi_hal.cpp
+++ b/qcwcn/wifi_hal/wifi_hal.cpp
@@ -927,7 +927,7 @@ static int wifi_update_driver_state(const char *state) {
ts.tv_nsec = 200 * 1000000L;
do {
- if (access(WIFI_DRIVER_STATE_CTRL_PARAM, R_OK|W_OK) == 0)
+ if (access(WIFI_DRIVER_STATE_CTRL_PARAM, W_OK) == 0)
break;
nanosleep(&ts, (struct timespec *)NULL);
} while (--count > 0); /* wait at most 1 second for completion. */