panfrost: Don't double-free when handling error for unsupported GPU

Setting the screen ro member before we checked gpu id means the error
case leads to a double-free because screen->ro is set and allocated
by parent who hanbdles de-alloc a second time after we destroyed the
screen we just created because ro was set.

Cc: mesa-stable

Signed-off-by: Carsten Haitzler <>
Part-of: <!14516>
48 jobs for !14516 with morello-panfrost-fix-invalid-gpu-id-crash in 14 minutes and 59 seconds (queued for 6 seconds)
latest merge request