From b762b8ce53da7c7a7a4d660878887681c86be61b Mon Sep 17 00:00:00 2001 From: Marcin Slusarz Date: Wed, 17 Feb 2010 19:04:01 +0100 Subject: [PATCH] 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 --- drivers/gpu/drm/nouveau/nouveau_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c b/drivers/gpu/drm/nouveau/nouveau_i2c.c index 70e994d28122..f0162c4a6b90 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) { -- 2.39.2