diff options
author | anholt <anholt@FreeBSD.org> | 2003-10-24 21:45:21 +0000 |
---|---|---|
committer | anholt <anholt@FreeBSD.org> | 2003-10-24 21:45:21 +0000 |
commit | 2fd31354d9e4c945cf1de39d75e7a45ba1ed36cc (patch) | |
tree | 7d925a9446440742a4ff452cd6daf1dd3da16864 | |
parent | bc60c7cbae93d3763d1db8d4b559bb9bfc60e790 (diff) | |
download | FreeBSD-src-2fd31354d9e4c945cf1de39d75e7a45ba1ed36cc.zip FreeBSD-src-2fd31354d9e4c945cf1de39d75e7a45ba1ed36cc.tar.gz |
Don't try to use dev->dma_lock unless dma is initialized (dev->dma != NULL)
in bufs_info sysctl handler. dev->dma and dev->dma_lock existence are
protected by DRM_LOCK(). Fixes panic on sysctl hw.dri when the device is
uninitialied (when you aren't in X).
-rw-r--r-- | sys/dev/drm/drm_sysctl.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/dev/drm/drm_sysctl.h b/sys/dev/drm/drm_sysctl.h index 00bf90e..ee25d90 100644 --- a/sys/dev/drm/drm_sysctl.h +++ b/sys/dev/drm/drm_sysctl.h @@ -226,12 +226,11 @@ static int DRM(bufs_info) DRM_SYSCTL_HANDLER_ARGS * copy of the whole structure and the relevant data from buflist. */ DRM_LOCK(); - DRM_SPINLOCK(&dev->dma_lock); if (dma == NULL) { - DRM_SPINUNLOCK(&dev->dma_lock); DRM_UNLOCK(); return 0; } + DRM_SPINLOCK(&dev->dma_lock); tempdma = *dma; templists = DRM(alloc)(sizeof(int) * dma->buf_count, DRM_MEM_BUFS); for (i = 0; i < dma->buf_count; i++) |