[Mesa-stable] [Mesa-dev] [PATCH] st/dri: check pscreen is valid before querying param

Dave Airlie airlied at gmail.com
Tue Jun 9 22:13:04 PDT 2015


I've forgotten the cc stable tag for 10.6 on this, please put this in 10.6.

Dave.

On 10 June 2015 at 13:56, Michel Dänzer <michel at daenzer.net> wrote:
> On 10.06.2015 12:53, Dave Airlie wrote:
>> 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).
>>
>> Signed-off-by: Dave Airlie <airlied at redhat.com>
>> ---
>>  src/gallium/state_trackers/dri/dri2.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
>> index 792d565..8d93f78 100644
>> --- a/src/gallium/state_trackers/dri/dri2.c
>> +++ b/src/gallium/state_trackers/dri/dri2.c
>> @@ -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;
>>     }
>>
>
> I think I've seen this crash before, maybe in a bug report.
>
> Acked-by: Michel Dänzer <michel.daenzer at amd.com>
>
>
> --
> Earthling Michel Dänzer               |               http://www.amd.com
> Libre software enthusiast             |             Mesa and X developer


More information about the mesa-stable mailing list