diff options
author | Hsiu-Chang Chen <hsiuchangchen@google.com> | 2023-09-06 15:19:42 +0530 |
---|---|---|
committer | Hsiu-Chang Chen <hsiuchangchen@google.com> | 2023-10-08 11:16:45 +0800 |
commit | 117acb489de66fccbf9fc772813cfe159b75ed3a (patch) | |
tree | 9b93689ae81b14ae3c9ea7d19a896082450a114a | |
parent | 553c4e981663ac26822d525336975b9e9d1c1615 (diff) | |
download | wlan-117acb489de66fccbf9fc772813cfe159b75ed3a.tar.gz |
WifiHal:Add Null check for mInfo and sock
If Wifi is turned off during the power save request is
in process, there is a chance of socket or wifiInfo
becoming NULL
Add a null check to block the call to NULL pointer.
Bug: 296957095
Test: Regression Test
Change-Id: Ibe6253591c6852e38378579fda67f0055612055a
CRs-Fixed: 3609145
-rw-r--r-- | wcn6740/qcwcn/wifi_hal/wificonfig.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/wcn6740/qcwcn/wifi_hal/wificonfig.cpp b/wcn6740/qcwcn/wifi_hal/wificonfig.cpp index 3217c72..9e955ef 100644 --- a/wcn6740/qcwcn/wifi_hal/wificonfig.cpp +++ b/wcn6740/qcwcn/wifi_hal/wificonfig.cpp @@ -956,6 +956,11 @@ wifi_error WiFiConfigCommand::requestEvent() res = WIFI_ERROR_OUT_OF_MEMORY; goto out; } + if (mInfo == NULL || mInfo->cmd_sock == NULL) { + ALOGE("%s: Wifi is turned of or socket is Null",__FUNCTION__); + res = WIFI_ERROR_UNKNOWN; + goto out; + } status = nl_send_auto_complete(mInfo->cmd_sock, mMsg.getMessage()); if (status < 0) { |