diff options
author | Thomas Hellstrom <unichrome@shipmail.org> | 2005-05-08 20:33:04 +0000 |
---|---|---|
committer | Thomas Hellstrom <unichrome@shipmail.org> | 2005-05-08 20:33:04 +0000 |
commit | e0fc400b681cb6b04ba0769c58f279a2aa4326a5 (patch) | |
tree | 2fe36e3aa3a93b5fb68a8893a9235f47f107a364 /shared/via_dma.c | |
parent | 6aae7bd5b061c6a8130787ba3ea5aa07c744eda9 (diff) |
VIA: Fix for oops when AGP ring-buffer initialization is called and there
is no AGP memory acquired.
Diffstat (limited to 'shared/via_dma.c')
-rw-r--r-- | shared/via_dma.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/shared/via_dma.c b/shared/via_dma.c index c6c14dc0..672552e4 100644 --- a/shared/via_dma.c +++ b/shared/via_dma.c @@ -189,6 +189,12 @@ static int via_initialize(drm_device_t * dev, return DRM_ERR(EFAULT); } + if (!dev->agp || !dev->agp->base) { + DRM_ERROR("%s called with no agp memory available\n", + __FUNCTION__); + return DRM_ERR(EFAULT); + } + dev_priv->ring.map.offset = dev->agp->base + init->offset; dev_priv->ring.map.size = init->size; dev_priv->ring.map.type = 0; |