From 2fd31354d9e4c945cf1de39d75e7a45ba1ed36cc Mon Sep 17 00:00:00 2001 From: anholt Date: Fri, 24 Oct 2003 21:45:21 +0000 Subject: 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). --- sys/dev/drm/drm_sysctl.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sys/dev/drm/drm_sysctl.h') 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++) -- cgit v1.1