Fix spurious error
Bug: 79542247
Test: error no longer appears
Change-Id: I2cf91c8cd937b81041a47e4b64a882445a80eb0b
diff --git a/MetadataCrypt.cpp b/MetadataCrypt.cpp
index 4a847e3..c14b9a2 100644
--- a/MetadataCrypt.cpp
+++ b/MetadataCrypt.cpp
@@ -79,9 +79,10 @@
}
std::string key_dir = data_rec->key_dir;
auto dir = key_dir + "/key";
- LOG(DEBUG) << "key_dir/key: " << key;
- if (!fs_mkdirs(dir.c_str(), 0700)) {
+ LOG(DEBUG) << "key_dir/key: " << dir;
+ if (fs_mkdirs(dir.c_str(), 0700)) {
PLOG(ERROR) << "Creating directories: " << dir;
+ return false;
}
auto temp = key_dir + "/tmp";
if (!android::vold::retrieveKey(create_if_absent, dir, temp, key)) return false;