freedreno: a2xx: fix crash when freeing context
authorJonathan Marek <jonathan@marek.ca>
Thu, 21 Jun 2018 21:06:29 +0000 (17:06 -0400)
committerRob Clark <robdclark@gmail.com>
Fri, 22 Jun 2018 12:23:10 +0000 (08:23 -0400)
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a2xx/fd2_program.c

index 9a774572514abc8b19971a01f56a4e166091f619..834a7c7fcd79c2ea6df68816dfc2c649d52d2c87 100644 (file)
@@ -54,6 +54,8 @@ create_shader(enum shader_t type)
 static void
 delete_shader(struct fd2_shader_stateobj *so)
 {
+       if (!so)
+               return;
        ir2_shader_destroy(so->ir);
        free(so->tokens);
        free(so->bin);