summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/state_trackers/egl/kms/native_kms.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/egl/kms/native_kms.c b/src/gallium/state_trackers/egl/kms/native_kms.c
index 860657349bc..79645865f3b 100644
--- a/src/gallium/state_trackers/egl/kms/native_kms.c
+++ b/src/gallium/state_trackers/egl/kms/native_kms.c
@@ -680,7 +680,7 @@ kms_display_destroy(struct native_display *ndpy)
if (kdpy->fd >= 0)
drmClose(kdpy->fd);
- if (kdpy->api)
+ if (kdpy->api && kdpy->api->destroy)
kdpy->api->destroy(kdpy->api);
FREE(kdpy);
}