Skip to content

Commit

Permalink
drm/nouveau: fix nouveau_i2c_find bounds checking
Browse files Browse the repository at this point in the history
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Marcin Slusarz authored and Ben Skeggs committed Feb 25, 2010
1 parent df31ef4 commit b762b8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/nouveau_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b762b8c

Please sign in to comment.