RIL: release unsol wakelock
Make sure to release unsol wakelock
BUG=28635279
Change-Id: I4bdf0e7b35df4e6aa077b062ab359c6938ce8292
diff --git a/ril/libril/ril.cpp b/ril/libril/ril.cpp
index 6711f18..7f086d1 100755
--- a/ril/libril/ril.cpp
+++ b/ril/libril/ril.cpp
@@ -563,6 +563,13 @@
pCI = &(s_commands[request]);
}
+ // Received an Ack for the previous result sent to RIL.java,
+ // so release wakelock and exit
+ if (request == RIL_RESPONSE_ACKNOWLEDGEMENT) {
+ releaseWakeLock();
+ return 0;
+ }
+
if (pCI == NULL) {
Parcel pErr;
RLOGE("unsupported request code %d token %d", request, token);
@@ -575,14 +582,7 @@
return 0;
}
- // Received an Ack for the previous result sent to RIL.java,
- // so release wakelock and exit
- if (request == RIL_RESPONSE_ACKNOWLEDGEMENT) {
- releaseWakeLock();
- return 0;
- }
-
- pRI = (RequestInfo *)calloc(1, sizeof(RequestInfo));
+ pRI = (RequestInfo *)calloc(1, sizeof(RequestInfo));
if (pRI == NULL) {
RLOGE("Memory allocation failed for request %s", requestToString(request));
return 0;