summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/via_dma.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/shared-core/via_dma.c b/shared-core/via_dma.c
index 0121f794..83c14cf0 100644
--- a/shared-core/via_dma.c
+++ b/shared-core/via_dma.c
@@ -165,7 +165,9 @@ static int via_dispatch_cmdbuffer(drm_device_t *dev,
if (vb == NULL) {
return DRM_ERR(EAGAIN);
}
- DRM_COPY_FROM_USER(vb, cmd->buf, cmd->size);
+ if (DRM_COPY_FROM_USER(vb, cmd->buf, cmd->size)) {
+ return DRM_ERR(EFAULT);
+ }
dev_priv->dma_low += cmd->size;
via_cmdbuf_pause(dev_priv);