drivers/gpu/drm/via/via_video.c: fix off by one issue
authorDan Carpenter <error27@gmail.com>
Tue, 27 Apr 2010 21:11:03 +0000 (14:11 -0700)
committerDave Airlie <airlied@redhat.com>
Wed, 28 Apr 2010 08:41:31 +0000 (18:41 +1000)
"fx->lock" is used as the index in "dev_priv->decoder_queue[fx->lock]"
which is an array of "VIA_NR_XVMC_LOCKS" elements.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/via/via_video.c

index 6ec04ac1245991ffea7bf1a5cf1197f4b411ea46..6efac8117c93c77a20eb7079bbdbb6c4440e58b3 100644 (file)
@@ -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);