diff options
-rw-r--r-- | sys/dev/pci/drm/drm_drv.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index d5d7d43185d..e948965dd93 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -452,6 +452,9 @@ drmclose(dev_t kdev, int flags, int fmt, struct proc *p) struct drm_file *file_priv; int retcode = 0; + if (dev == NULL) + return (ENXIO); + DRM_DEBUG("open_count = %d\n", dev->open_count); DRM_LOCK(); @@ -709,6 +712,9 @@ drmmmap(dev_t kdev, off_t offset, int prot) struct drm_file *priv; enum drm_map_type type; + if (dev == NULL) + return (-1); + DRM_LOCK(); priv = drm_find_file_by_minor(dev, minor(kdev)); DRM_UNLOCK(); |