summaryrefslogtreecommitdiff
path: root/src/sna/sna_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sna/sna_driver.c')
-rw-r--r--src/sna/sna_driver.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 5d42e69c..fb54a24c 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -1047,7 +1047,7 @@ static Bool sna_pm_event(int scrnIndex, pmEvent event, Bool undo)
return TRUE;
}
-void sna_init_scrn(ScrnInfoPtr scrn, int entity_num)
+Bool sna_init_scrn(ScrnInfoPtr scrn, int entity_num)
{
EntityInfoPtr entity;
@@ -1081,8 +1081,13 @@ void sna_init_scrn(ScrnInfoPtr scrn, int entity_num)
xf86SetEntitySharable(scrn->entityList[0]);
entity = xf86GetEntityInfo(entity_num);
+ if (!entity)
+ return FALSE;
+
xf86SetEntityInstanceForScreen(scrn,
entity->index,
xf86GetNumEntityInstances(entity->index)-1);
free(entity);
+
+ return TRUE;
}