st/dri: check pscreen is valid before querying param
authorDave Airlie <airlied@gmail.com>
Wed, 10 Jun 2015 03:51:59 +0000 (13:51 +1000)
committerDave Airlie <airlied@gmail.com>
Wed, 10 Jun 2015 04:10:33 +0000 (14:10 +1000)
we don't check the validity of pscreen until dri_init_screen_helper

hit this trying to init glamor on a device with no driver (udl).

Acked-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/state_trackers/dri/dri2.c

index 792d56516984c81e086e13f28ac6ed1fff31b1c2..8d93f786433f0262a390428b91956200c01741f7 100644 (file)
@@ -1483,7 +1483,7 @@ dri2_init_screen(__DRIscreen * sPriv)
       }
    }
 
-   if (pscreen->get_param(pscreen, PIPE_CAP_DEVICE_RESET_STATUS_QUERY)) {
+   if (pscreen && pscreen->get_param(pscreen, PIPE_CAP_DEVICE_RESET_STATUS_QUERY)) {
       sPriv->extensions = dri_robust_screen_extensions;
       screen->has_reset_status_query = true;
    }