[ofa-general] madeye kernel oops

Ami Perlmutter amip at dev.mellanox.co.il
Wed Apr 4 00:39:25 PDT 2007


seems to be OK

On Mon, 2007-04-02 at 12:49 -0700, Sean Hefty wrote:
> Can you see if this patch fixes your problem?
> 
> (I'm not sure how I never hit this before.)
> 
> - Sean
> 
> ---
> 
>     IB/madeye: Fix array subscript out of range error.
>     
>     Signed-off-by: Sean Hefty <sean.hefty at intel.com>
> 
> diff --git a/drivers/infiniband/util/madeye/madeye.c
> b/drivers/infiniband/util/madeye/madeye.c
> index f3d02d1..1b2c384 100644
> --- a/drivers/infiniband/util/madeye/madeye.c
> +++ b/drivers/infiniband/util/madeye/madeye.c
> @@ -533,7 +533,7 @@ static void madeye_add_one(struct ib_device *device)
>  		goto out;
>  
>  	reg_flags = IB_MAD_SNOOP_SEND_COMPLETIONS | IB_MAD_SNOOP_RECVS;
> -	for (i = s; i <= e; i++) {
> +	for (i = 0; i <= e - s; i++) {
>  		port[i].smi_agent = ib_register_mad_snoop(device, i,
>  							  IB_QPT_SMI,
>  							  reg_flags,
> @@ -570,7 +570,7 @@ static void madeye_remove_one(struct ib_device *device)
>  		e = device->phys_port_cnt;
>  	}
>  
> -	for (i = s; i <= e; i++) {
> +	for (i = 0; i <= e - s; i++) {
>  		if (!IS_ERR(port[i].smi_agent))
>  			ib_unregister_mad_agent(port[i].smi_agent);
>  		if (!IS_ERR(port[i].gsi_agent))
> 




More information about the general mailing list