diff options
author | Dan Carpenter <error27@gmail.com> | 2010-05-25 05:52:27 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-06-07 21:03:38 -0400 |
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 47a27a4728d..fc924b64919 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) | |||
834 | if (i2c_index == 0x81) | 834 | if (i2c_index == 0x81) |
835 | i2c_index = (dcb->i2c_default_indices & 0xf0) >> 4; | 835 | i2c_index = (dcb->i2c_default_indices & 0xf0) >> 4; |
836 | 836 | ||
837 | if (i2c_index > DCB_MAX_NUM_I2C_ENTRIES) { | 837 | if (i2c_index >= DCB_MAX_NUM_I2C_ENTRIES) { |
838 | NV_ERROR(dev, "invalid i2c_index 0x%x\n", i2c_index); | 838 | NV_ERROR(dev, "invalid i2c_index 0x%x\n", i2c_index); |
839 | return NULL; | 839 | return NULL; |
840 | } | 840 | } |