diff --git a/dom/storage/DOMStorageDBThread.cpp b/dom/storage/DOMStorageDBThread.cpp
index e5fc7d7eb..a4b6a3f33 100644
--- a/dom/storage/DOMStorageDBThread.cpp
+++ b/dom/storage/DOMStorageDBThread.cpp
@@ -874,7 +874,10 @@ DOMStorageDBThread::DBOperation::Perform(DOMStorageDBThread* aThread)
       }
     }
 
-    mCache->LoadDone(NS_OK);
+    // The loop condition's call to ExecuteStep() may have terminated because
+    // !NS_SUCCEEDED(), we need an early return to cover that case.  This also
+    // covers success cases as well, but that's inductively safe.
+    NS_ENSURE_SUCCESS(rv, rv);
     break;
   }
 
diff --git a/dom/storage/DOMStorageIPC.cpp b/dom/storage/DOMStorageIPC.cpp
index 411a9c3e4..c8d2c2586 100644
--- a/dom/storage/DOMStorageIPC.cpp
+++ b/dom/storage/DOMStorageIPC.cpp
@@ -442,6 +442,7 @@ public:
   virtual bool LoadItem(const nsAString& aKey, const nsString& aValue)
   {
     // Called on the aCache background thread
+    MOZ_ASSERT(!mLoaded);
     if (mLoaded) {
       return false;
     }
@@ -456,8 +457,12 @@ public:
   {
     // Called on the aCache background thread
     MonitorAutoLock monitor(mMonitor);
+    MOZ_ASSERT(!mLoaded && mRv);
     mLoaded = true;
-    *mRv = aRv;
+    if (mRv) {
+      *mRv = aRv;
+      mRv = nullptr;
+    }
     monitor.Notify();
   }
 
