Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75047944 authored by Dan Carpenter's avatar Dan Carpenter Committed by Dave Airlie
Browse files

drm/nouveau: off by one in init_i2c_device_find()



dcb->i2c[] has DCB_MAX_NUM_I2C_ENTRIES entries.

Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 55a4c5c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}