diff options
author | Amarnath Hullur Subramanyam <amarnath@codeaurora.org> | 2015-10-14 17:16:10 +0530 |
---|---|---|
committer | Ravi Joshi <ravij@codeaurora.org> | 2015-10-23 13:34:34 -0700 |
commit | 8c67f98ddba17a063b41c7736f83ab74c0138626 (patch) | |
tree | 620e6ca99af83be59e0d53f8dc8aa2af9e937612 /service/java/com/android/server/wifi/WifiNative.java | |
parent | 076e35585ebca2745b9dc6ae37e21b56a84a29a8 (diff) | |
download | android_frameworks_opt_net_wifi-8c67f98ddba17a063b41c7736f83ab74c0138626.tar.gz android_frameworks_opt_net_wifi-8c67f98ddba17a063b41c7736f83ab74c0138626.tar.bz2 android_frameworks_opt_net_wifi-8c67f98ddba17a063b41c7736f83ab74c0138626.zip |
Reset HAL logging handlers before resetting local handlers
If local logging handlers are getting reset before resetting
hal handlers, a possible NULL pointer access can occur in
onRingBufferData() if the sWifiLoggerEventHandler is set to null
before sWifiLoggerEventHandler.onRingBufferData() call and
the NULL check just before it. To avoid this possible crash,
reset the hal handlers before resetting sWifiLoggerEventHandler,
so that HAL doesn't invoke onRingBufferData() callback during
sWifiLoggerEventHandler is getting reset
Change-Id: I40edfbc17c4cffc215d276203943f7c84790bc86
CRs-Fixed: 919288
Diffstat (limited to 'service/java/com/android/server/wifi/WifiNative.java')
-rw-r--r-- | service/java/com/android/server/wifi/WifiNative.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiNative.java b/service/java/com/android/server/wifi/WifiNative.java index e37ed9d87..2880cbd70 100644 --- a/service/java/com/android/server/wifi/WifiNative.java +++ b/service/java/com/android/server/wifi/WifiNative.java @@ -2116,11 +2116,12 @@ public class WifiNative { Log.e(TAG,"Can not reset handler Before set any handler"); return false; } - sWifiLoggerEventHandler = null; if (resetLogHandlerNative(sWlan0Index, sLogCmdId)) { sLogCmdId = -1; + sWifiLoggerEventHandler = null; return true; } else { + sWifiLoggerEventHandler = null; return false; } } else { |