mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
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>
This commit is contained in:
parent
55a4c5c515
commit
7504794448
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue