The check should be >= instead of > or we could potentially go past the end of the array.
Found by a smatch static checker and compile tested only. Signed-off-by: Dan Carpenter <erro...@gmail.com> --- orig/drivers/gpu/drm/via/via_video.c 2009-12-27 13:19:36.000000000 +0200 +++ devel/drivers/gpu/drm/via/via_video.c 2009-12-27 13:19:53.000000000 +0200 @@ -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); ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel