diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2011-05-02 18:12:48 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2011-05-02 18:12:48 +0000 |
commit | b261a589e4d8920a0f39fc773df155ad6a5322c4 (patch) | |
tree | 8ae89ea194a73274b266c606d2b696224040ecd9 /sys | |
parent | f4cb631c74cdc269ca00c4473c8dd5840eaaeea7 (diff) |
Some extra paranoia for if we fail to attach.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/drm/drm_drv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index 6a8b7d19c64..79878fe3874 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -219,6 +219,7 @@ drm_attach(struct device *parent, struct device *self, void *aux) error: drm_lastclose(dev); + dev->dev_private = NULL; } int @@ -387,7 +388,7 @@ drmopen(dev_t kdev, int flags, int fmt, struct proc *p) int ret = 0; dev = drm_get_device_from_kdev(kdev); - if (dev == NULL) + if (dev == NULL || dev->dev_private == NULL) return (ENXIO); DRM_DEBUG("open_count = %d\n", dev->open_count); |