NVMeMiFake: bug fix for unsupported log page Add return to the error path, otherwise the callback will be triggered twice. Testd: unitest test passed Signed-off-by: Hao Jiang <jianghao@google.com> Change-Id: I817ce038139de8e63f7390f8c6a6434ecd6c3d5f
diff --git a/src/NVMeMiFake.hpp b/src/NVMeMiFake.hpp index 12e4875..e7bbe00 100644 --- a/src/NVMeMiFake.hpp +++ b/src/NVMeMiFake.hpp
@@ -260,6 +260,7 @@ { self->io.post( [cb{cb}, ec = e.code()]() mutable { cb(ec, {}); }); + return; } self->io.post([cb{cb}, data{std::move(data)}]() mutable { std::span<uint8_t> span{data.data(), data.size()};