diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c
index ab3985a61..54162b6bc 100644
--- a/src/video/kmsdrm/SDL_kmsdrmvideo.c
+++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c
@@ -576,9 +576,7 @@ cleanup:
 void
 free_plane(struct plane **plane)
 {
-    SDL_DisplayData *dispdata = (SDL_DisplayData *)SDL_GetDisplayDriverData(0);
-
-    if (dispdata && (*plane)) {
+    if (*plane) {
         if ((*plane)->plane) {
             KMSDRM_drmModeFreePlane((*plane)->plane);
             (*plane)->plane = NULL;