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

Commit b762b8ce authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Ben Skeggs
Browse files

drm/nouveau: fix nouveau_i2c_find bounds checking

parent df31ef4d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ nouveau_i2c_find(struct drm_device *dev, int index)
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	struct nvbios *bios = &dev_priv->VBIOS;

	if (index > DCB_MAX_NUM_I2C_ENTRIES)
	if (index >= DCB_MAX_NUM_I2C_ENTRIES)
		return NULL;

	if (!bios->bdcb.dcb.i2c[index].chan) {