diff options
-rw-r--r-- | shared-core/via_dma.c | 4 | ||||
-rw-r--r-- | shared/via_dma.c | 4 |
2 files changed, 6 insertions, 2 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); diff --git a/shared/via_dma.c b/shared/via_dma.c index 0121f794..83c14cf0 100644 --- a/shared/via_dma.c +++ b/shared/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); |