From: Dan Carpenter <[email protected]>

"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 <[email protected]>
Cc: David Airlie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---

 drivers/gpu/drm/via/via_video.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN 
drivers/gpu/drm/via/via_video.c~drivers-gpu-drm-via-via_videoc-fix-off-by-one-issue
 drivers/gpu/drm/via/via_video.c
--- 
a/drivers/gpu/drm/via/via_video.c~drivers-gpu-drm-via-via_videoc-fix-off-by-one-issue
+++ a/drivers/gpu/drm/via/via_video.c
@@ -75,7 +75,7 @@ int via_decoder_futex(struct drm_device 
 
        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);
_

------------------------------------------------------------------------------
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to