From fcf3fc08e4208f1997fd9e8f10fbda865f2c20c6 Mon Sep 17 00:00:00 2001 From: David Drysdale Date: Thu, 28 Oct 2021 15:13:47 +0100 Subject: [PATCH] KeyMint: don't mix Binder and std shared pointers Bug: 203871378 Test: VtsAidlKeyMintTargetTest, TreeHugger Change-Id: I8671342939af2bbdef643be9ce81b0bb9e7ae1a9 --- trusty/keymaster/keymint/service.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trusty/keymaster/keymint/service.cpp b/trusty/keymaster/keymint/service.cpp index 4060278d4..d5a77fb3e 100644 --- a/trusty/keymaster/keymint/service.cpp +++ b/trusty/keymaster/keymint/service.cpp @@ -31,7 +31,7 @@ using aidl::android::hardware::security::sharedsecret::trusty::TrustySharedSecre template std::shared_ptr addService(Args&&... args) { - std::shared_ptr service = std::make_shared(std::forward(args)...); + std::shared_ptr service = ndk::SharedRefBase::make(std::forward(args)...); auto instanceName = std::string(T::descriptor) + "/default"; LOG(ERROR) << "Adding service instance: " << instanceName; auto status = AServiceManager_addService(service->asBinder().get(), instanceName.c_str());