Skip to content

Commit

Permalink
drivers/gpu/drm/via/via_video.c: fix off by one issue
Browse files Browse the repository at this point in the history
"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>
  • Loading branch information
Dan Carpenter authored and Dave Airlie committed Apr 28, 2010
1 parent ccb2ad5 commit 22fb573
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/via/via_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 22fb573

Please sign in to comment.