Index: i915_dma.c =================================================================== RCS file: /cvs/dri/drm/shared-core/i915_dma.c,v retrieving revision 1.30 diff -u -r1.30 i915_dma.c --- i915_dma.c 24 Jan 2006 21:24:53 -0000 1.30 +++ i915_dma.c 17 Feb 2006 05:14:07 -0000 @@ -344,8 +344,10 @@ int i; RING_LOCALS; - if ((dwords+1) * sizeof(int) >= dev_priv->ring.Size - 8) + if ((dwords+1) * sizeof(int) >= dev_priv->ring.Size - 8) { + DRM_ERROR("Too many dwords (%d,%d)",dwords,dev_priv->ring.Size); return DRM_ERR(EINVAL); + } BEGIN_LP_RING(((dwords+1)&~1)); @@ -355,8 +357,10 @@ if (DRM_COPY_FROM_USER_UNCHECKED(&cmd, &buffer[i], sizeof(cmd))) return DRM_ERR(EINVAL); - if ((sz = validate_cmd(cmd)) == 0 || i + sz > dwords) + if ((sz = validate_cmd(cmd)) == 0 || i + sz > dwords) { + DRM_ERROR("validate failed (%d,%d,%d)",sz,i,dwords); return DRM_ERR(EINVAL); + } OUT_RING(cmd);