diff --git a/sys/dev/drm/drm_file.c b/sys/dev/drm/drm_file.c --- a/sys/dev/drm/drm_file.c +++ b/sys/dev/drm/drm_file.c @@ -371,7 +371,12 @@ #endif struct drm_file *file_priv = filp->private_data; struct drm_minor *minor = drm_minor_acquire(iminor(inode)); - struct drm_device *dev = minor->dev; + struct drm_device *dev; + + if (IS_ERR(minor)) + return; + + dev = minor->dev; mutex_lock(&drm_global_mutex);