From: Marcin Slusarz Date: Wed, 17 Feb 2010 18:04:01 +0000 (+0100) Subject: drm/nouveau: fix nouveau_i2c_find bounds checking X-Git-Tag: upstream/snapshot3+hdmi~14679^2~84^2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b762b8ce53da7c7a7a4d660878887681c86be61b;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git drm/nouveau: fix nouveau_i2c_find bounds checking Reported-by: Dan Carpenter Signed-off-by: Marcin Slusarz Signed-off-by: Francisco Jerez Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c b/drivers/gpu/drm/nouveau/nouveau_i2c.c index 70e994d..f0162c4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_i2c.c +++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c @@ -256,7 +256,7 @@ nouveau_i2c_find(struct drm_device *dev, int index) struct drm_nouveau_private *dev_priv = dev->dev_private; struct nvbios *bios = &dev_priv->VBIOS; - if (index > DCB_MAX_NUM_I2C_ENTRIES) + if (index >= DCB_MAX_NUM_I2C_ENTRIES) return NULL; if (!bios->bdcb.dcb.i2c[index].chan) {