Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22fb573a authored by Dan Carpenter's avatar Dan Carpenter Committed by Dave Airlie
Browse files

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: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent ccb2ad57
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);