Dont accidentally remove a filesocket which is still in use. This gives
problems when the DRM driver is loaded and the AIXGL extension is loaded , the AIXGL driver requests a drm_close and this will cause the radeon driver to fail while starting X windows. PR: kern/114688 Submitted by: vehemens <vehemens at verizon dot net> Prodded by: Robert Noland Approved by: imp (mentor, a while ago already), anholt MFC After: 1 week
This commit is contained in:
parent
82d16f31df
commit
149e9017bd
@ -711,6 +711,9 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p)
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
if (--priv->refs != 0)
|
||||
goto done;
|
||||
|
||||
if (dev->driver.preclose != NULL)
|
||||
dev->driver.preclose(dev, filp);
|
||||
|
||||
@ -786,17 +789,17 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p)
|
||||
dev->buf_pgid = 0;
|
||||
#endif /* __NetBSD__ || __OpenBSD__ */
|
||||
|
||||
if (--priv->refs == 0) {
|
||||
if (dev->driver.postclose != NULL)
|
||||
dev->driver.postclose(dev, priv);
|
||||
TAILQ_REMOVE(&dev->files, priv, link);
|
||||
free(priv, M_DRM);
|
||||
}
|
||||
if (dev->driver.postclose != NULL)
|
||||
dev->driver.postclose(dev, priv);
|
||||
|
||||
TAILQ_REMOVE(&dev->files, priv, link);
|
||||
free(priv, M_DRM);
|
||||
|
||||
/* ========================================================
|
||||
* End inline drm_release
|
||||
*/
|
||||
|
||||
done:
|
||||
atomic_inc( &dev->counts[_DRM_STAT_CLOSES] );
|
||||
#ifdef __FreeBSD__
|
||||
device_unbusy(dev->device);
|
||||
|
Loading…
Reference in New Issue
Block a user