diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index fb5b3f8..995a910 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -2445,33 +2445,37 @@
             }
             mNetworkRequestInfoLogs.log("RELEASE " + nri);
             if (nri.request.isRequest()) {
+                boolean wasKept = false;
+                NetworkAgentInfo nai = mNetworkForRequestId.get(nri.request.requestId);
+                if (nai != null) {
+                    nai.removeRequest(nri.request.requestId);
+                    if (VDBG) {
+                        log(" Removing from current network " + nai.name() +
+                                ", leaving " + nai.numNetworkRequests() + " requests.");
+                    }
+                    if (unneeded(nai)) {
+                        if (DBG) log("no live requests for " + nai.name() + "; disconnecting");
+                        teardownUnneededNetwork(nai);
+                    } else {
+                        wasKept = true;
+                    }
+                    mNetworkForRequestId.remove(nri.request.requestId);
+                }
+
+                // TODO: remove this code once we know that the Slog.wtf is never hit.
+                //
                 // Find all networks that are satisfying this request and remove the request
                 // from their request lists.
                 // TODO - it's my understanding that for a request there is only a single
                 // network satisfying it, so this loop is wasteful
-                boolean wasKept = false;
-                for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
-                    if (nai.isSatisfyingRequest(nri.request.requestId)) {
-                        nai.removeRequest(nri.request.requestId);
-                        if (VDBG) {
-                            log(" Removing from current network " + nai.name() +
-                                    ", leaving " + nai.numNetworkRequests() + " requests.");
-                        }
-                        if (unneeded(nai)) {
-                            if (DBG) log("no live requests for " + nai.name() + "; disconnecting");
-                            teardownUnneededNetwork(nai);
-                        } else {
-                            // suspect there should only be one pass through here
-                            // but if any were kept do the check below
-                            wasKept |= true;
-                        }
+                for (NetworkAgentInfo otherNai : mNetworkAgentInfos.values()) {
+                    if (otherNai.isSatisfyingRequest(nri.request.requestId) && otherNai != nai) {
+                        Slog.wtf(TAG, "Request " + nri.request + " satisfied by " +
+                                otherNai.name() + ", but mNetworkAgentInfos says " +
+                                (nai != null ? nai.name() : "null"));
                     }
                 }
 
-                NetworkAgentInfo nai = mNetworkForRequestId.get(nri.request.requestId);
-                if (nai != null) {
-                    mNetworkForRequestId.remove(nri.request.requestId);
-                }
                 // Maintain the illusion.  When this request arrived, we might have pretended
                 // that a network connected to serve it, even though the network was already
                 // connected.  Now that this request has gone away, we might have to pretend
