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: MMI-PSA29.97-13-9~23984^2~84^2~30 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b762b8ce53da7c7a7a4d660878887681c86be61b;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.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 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) {