提交 75047944 编写于 作者: D Dan Carpenter 提交者: Dave Airlie

drm/nouveau: off by one in init_i2c_device_find()

dcb->i2c[] has DCB_MAX_NUM_I2C_ENTRIES entries.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 55a4c5c5
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册