[ofa-general] [PATCH] IB/core - remove redundant NULL pointer checkin ib_mad_recv_done_handler()

Ralph Campbell ralph.campbell at qlogic.com
Thu Oct 18 10:26:35 PDT 2007


git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git
master branch as of a few days ago.

I guess you figured out what happened to the earlier patch though
already.

On Thu, 2007-10-18 at 09:31 -0400, Suresh Shelvapille wrote:
> Ralph:
> 
> Which version are you looking at? We cleaned it up already in 2.6.23(rcx) 
> and I don't see it.
> 
> Thanks,
> Suri
> 
> > -----Original Message-----
> > From: general-bounces at lists.openfabrics.org [mailto:general-bounces at lists.openfabrics.org] On Behalf
> > Of Ralph Campbell
> > Sent: Wednesday, October 17, 2007 9:07 PM
> > To: openib
> > Subject: [ofa-general] [PATCH] IB/core - remove redundant NULL pointer checkin
> > ib_mad_recv_done_handler()
> > 
> > In ib_mad_recv_done_handler(), the response pointer is checked for
> > NULL after allocating it.  It is then checked again in the local
> > process_mad() path but there is no possibility of it changing
> > in between.
> > 
> > Signed-off-by: Ralph Campbell <ralph.campbell at qlogic.com>
> > 
> > diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
> > index 6f42877..f82900d 100644
> > --- a/drivers/infiniband/core/mad.c
> > +++ b/drivers/infiniband/core/mad.c
> > @@ -1931,15 +1931,6 @@ local:
> >  	if (port_priv->device->process_mad) {
> >  		int ret;
> > 
> > -		if (!response) {
> > -			printk(KERN_ERR PFX "No memory for response MAD\n");
> > -			/*
> > -			 * Is it better to assume that
> > -			 * it wouldn't be processed ?
> > -			 */
> > -			goto out;
> > -		}
> > -
> >  		ret = port_priv->device->process_mad(port_priv->device, 0,
> >  						     port_priv->port_num,
> >  						     wc, &recv->grh,
> > 
> > 
> > _______________________________________________
> > general mailing list
> > general at lists.openfabrics.org
> > http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
> > 
> > To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
> 




More information about the general mailing list