kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] drm/nouveau: off by one in init_i2c_device_find()
@ 2010-05-25  9:52 Dan Carpenter
  2010-06-03  1:22 ` Ben Skeggs
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-05-25  9:52 UTC (permalink / raw)
  To: David Airlie; +Cc: kernel-janitors, Ben Skeggs, dri-devel

dcb->i2c[] has DCB_MAX_NUM_I2C_ENTRIES entries.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index e7e69cc..bf92a1e 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -814,7 +814,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;
 	}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] drm/nouveau: off by one in init_i2c_device_find()
  2010-05-25  9:52 [patch] drm/nouveau: off by one in init_i2c_device_find() Dan Carpenter
@ 2010-06-03  1:22 ` Ben Skeggs
  0 siblings, 0 replies; 2+ messages in thread
From: Ben Skeggs @ 2010-06-03  1:22 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: kernel-janitors, dri-devel

On Tue, 2010-05-25 at 11:52 +0200, Dan Carpenter wrote:
> dcb->i2c[] has DCB_MAX_NUM_I2C_ENTRIES entries.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Thanks, picked this up in the nouveau tree.

> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
> index e7e69cc..bf92a1e 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bios.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
> @@ -814,7 +814,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;
>  	}



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-03  1:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-25  9:52 [patch] drm/nouveau: off by one in init_i2c_device_find() Dan Carpenter
2010-06-03  1:22 ` Ben Skeggs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).