hwc: Fix null dereference
Fix possible null dereference in hwc. Change-Id: Ib403d4b742cc52175b93268c023ba273377e7b91
This commit is contained in:
@@ -259,9 +259,15 @@ void initContext(hwc_context_t *ctx)
|
|||||||
//independent process as well.
|
//independent process as well.
|
||||||
QService::init();
|
QService::init();
|
||||||
sp<IQClient> client = new QClient(ctx);
|
sp<IQClient> client = new QClient(ctx);
|
||||||
interface_cast<IQService>(
|
android::sp<qService::IQService> qservice_sp = interface_cast<IQService>(
|
||||||
defaultServiceManager()->getService(
|
defaultServiceManager()->getService(
|
||||||
String16("display.qservice")))->connect(client);
|
String16("display.qservice")));
|
||||||
|
if (qservice_sp.get()) {
|
||||||
|
qservice_sp->connect(client);
|
||||||
|
} else {
|
||||||
|
ALOGE("%s: Failed to acquire service pointer", __FUNCTION__);
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize device orientation to its default orientation
|
// Initialize device orientation to its default orientation
|
||||||
ctx->deviceOrientation = 0;
|
ctx->deviceOrientation = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user