Prevent spurious call to keymaster abort().
During the analysis of b/72953784 it was noticed that vold was calling keymaster abort() and failing, though vold was succeeding with its keymaster operation. This had nothing to do with the bug, but the presence of the error appeared to implicate keymaster, and it's bad form in any case. This CL correctly clears the mDevice member during a move, so the destructor will not attempt to call abort. Test: Build & boot Bug: 72953784 Change-Id: Ib0700f829e87f19b089396087085585ddd6b96a5
This commit is contained in:
parent
0fd2626fc3
commit
3e02df8d3c
1 changed files with 8 additions and 4 deletions
12
Keymaster.h
12
Keymaster.h
|
@ -66,11 +66,15 @@ class KeymasterOperation {
|
||||||
KeymasterOperation() : mDevice{nullptr}, mOpHandle{0}, mError{km::ErrorCode::UNKNOWN_ERROR} {}
|
KeymasterOperation() : mDevice{nullptr}, mOpHandle{0}, mError{km::ErrorCode::UNKNOWN_ERROR} {}
|
||||||
// Move Assignment
|
// Move Assignment
|
||||||
KeymasterOperation& operator=(KeymasterOperation&& rhs) {
|
KeymasterOperation& operator=(KeymasterOperation&& rhs) {
|
||||||
mDevice = std::move(rhs.mDevice);
|
mDevice = rhs.mDevice;
|
||||||
mOpHandle = std::move(rhs.mOpHandle);
|
rhs.mDevice = nullptr;
|
||||||
mError = std::move(rhs.mError);
|
|
||||||
rhs.mError = km::ErrorCode::UNKNOWN_ERROR;
|
mOpHandle = rhs.mOpHandle;
|
||||||
rhs.mOpHandle = 0;
|
rhs.mOpHandle = 0;
|
||||||
|
|
||||||
|
mError = rhs.mError;
|
||||||
|
rhs.mError = km::ErrorCode::UNKNOWN_ERROR;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue