Merge "Reset failed decryption count on successful decryptions" into lmp-dev
diff --git a/cryptfs.c b/cryptfs.c
index 606b9f1..ec565c8 100644
--- a/cryptfs.c
+++ b/cryptfs.c
@@ -1797,6 +1797,9 @@
 
   if (rc == 0) {
     crypt_ftr->failed_decrypt_count = 0;
+    if (orig_failed_decrypt_count != 0) {
+      put_crypt_ftr_and_key(crypt_ftr);
+    }
 
     /* Save the name of the crypto block device
      * so we can mount it when restarting the framework. */