summaryrefslogtreecommitdiff
path: root/shared-core/via_dma.c
diff options
context:
space:
mode:
authorJon Smirl <jonsmirl@yahoo.com>2004-09-12 03:23:50 +0000
committerJon Smirl <jonsmirl@yahoo.com>2004-09-12 03:23:50 +0000
commit36050cc958596ca81d667d8a51e124e9ea9eb866 (patch)
treece3138523ba7c8e91646bd9f530386a1a9ed7f6d /shared-core/via_dma.c
parente6d468ad7f398a72e8be227564f3a450de873cc6 (diff)
Fix DRM to compile cleanly with recent kernel changes in PCI IO and
DRM_COPY_FROM_USER. PCI IO changes in 2.6.9-rc1 bk currently.
Diffstat (limited to 'shared-core/via_dma.c')
-rw-r--r--shared-core/via_dma.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/shared-core/via_dma.c b/shared-core/via_dma.c
index c11652c0..4afc5215 100644
--- a/shared-core/via_dma.c
+++ b/shared-core/via_dma.c
@@ -275,11 +275,13 @@ static int via_dispatch_pci_cmdbuffer(drm_device_t *dev,
} else if ( cmd->size > VIA_PREALLOCATED_PCI_SIZE ) {
if (NULL == (hugebuf = (char *) kmalloc( cmd-> size, GFP_KERNEL )))
return DRM_ERR( ENOMEM );
- DRM_COPY_FROM_USER( hugebuf, cmd->buf, cmd->size );
+ if (DRM_COPY_FROM_USER( hugebuf, cmd->buf, cmd->size ))
+ return DRM_ERR(EFAULT);
ret = via_parse_pci_cmdbuffer( dev, hugebuf, cmd->size );
kfree( hugebuf );
} else {
- DRM_COPY_FROM_USER( dev_priv->pci_buf, cmd->buf, cmd->size );
+ if (DRM_COPY_FROM_USER( dev_priv->pci_buf, cmd->buf, cmd->size ))
+ return DRM_ERR(EFAULT);
ret = via_parse_pci_cmdbuffer( dev, dev_priv->pci_buf, cmd->size );
}
return ret;