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:
Jignesh Mehta 2020-08-19 21:59:08 -07:00 committed by pix106
parent 401a0afb8a
commit 123d8346a3

View file

@ -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());