提交 22fb573a 编写于 作者: D Dan Carpenter 提交者: Dave Airlie

drivers/gpu/drm/via/via_video.c: fix 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.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Acked-by: NThomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 ccb2ad57
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册