st/dri: add null-pointer check, remove duplicated local variable

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
1 file changed