Skip to contentSkip to conversation

via: off by one issue

PATCH New Dan Carpenter 1 participant 1 message Mar 28, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 via: off by one issue

"fx->lock" is used as the index in "dev_priv->decoder_queue[fx->lock]" which is an array of "VIA_NR_XVMC_LOCKS" elements.

drivers/gpu/drm/via/via_video.c +1 -1
index 6ec04ac..6efac81 100644
@@ -75,7 +75,7 @@ int via_decoder_futex(struct drm_device *dev, void *data, struct drm_file *file_
 
 	DRM_DEBUG("\n");
 
-	if (fx->lock > VIA_NR_XVMC_LOCKS)
+	if (fx->lock >= VIA_NR_XVMC_LOCKS)
 		return -EFAULT;
 
 	lock = (volatile int *)XVMCLOCKPTR(sAPriv, fx->lock);