diff options
author | Dan Carpenter <error27@gmail.com> | 2010-05-25 11:52:27 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-06-08 11:03:38 +1000 |
commit | 75047944480a33afad76a272b21116d032ba61fa (patch) | |
tree | 87a33c22e8fce4ca7d12cbafd501d681b372caba /drivers/gpu | |
parent | 55a4c5c515c1f4b4bde00c443e71ff9f3822013e (diff) |
drm/nouveau: off by one in init_i2c_device_find()
dcb->i2c[] has DCB_MAX_NUM_I2C_ENTRIES entries.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index 47a27a4728da..fc924b649195 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c @@ -834,7 +834,7 @@ init_i2c_device_find(struct drm_device *dev, int i2c_index) if (i2c_index == 0x81) i2c_index = (dcb->i2c_default_indices & 0xf0) >> 4; - if (i2c_index > DCB_MAX_NUM_I2C_ENTRIES) { + if (i2c_index >= DCB_MAX_NUM_I2C_ENTRIES) { NV_ERROR(dev, "invalid i2c_index 0x%x\n", i2c_index); return NULL; } |