sdm660-common: Add null check for lights smart pointer
lights smart pointer was used without null pointer check. This change adds null check. Change-Id: Ifdd82290cfe4d7ca781adbed8c8a65961c70e244 Signed-off-by: pix106 <sbordenave@gmail.com>
This commit is contained in:
parent
401a0afb8a
commit
123d8346a3
1 changed files with 3 additions and 0 deletions
|
@ -24,6 +24,9 @@ using ::aidl::android::hardware::light::Lights;
|
|||
int main() {
|
||||
ABinderProcess_setThreadPoolMaxThreadCount(0);
|
||||
std::shared_ptr<Lights> lights = ndk::SharedRefBase::make<Lights>();
|
||||
if (!lights) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
const std::string instance = std::string() + Lights::descriptor + "/default";
|
||||
binder_status_t status = AServiceManager_addService(lights->asBinder().get(), instance.c_str());
|
||||
|
|
Loading…
Reference in a new issue