What is the severity of this issue?  Is this a patch for 2.6.27?

 > -    rx->rx_ring = kcalloc(ipoib_recvq_size, sizeof *rx->rx_ring, 
 > GFP_KERNEL);
 > -    if (!rx->rx_ring)
 > +    rx->rx_ring = vmalloc( ipoib_recvq_size * sizeof *rx->rx_ring);

no space after '(' here.

 > +
 > +    if (!rx->rx_ring){
 > +            printk(KERN_WARNING "ipoib_cm:Allocation of rx_ring failed, %s",
 > +                    "try using a lower value of recv_queue_size.\n");
 >              return -ENOMEM;
 > +    }
 >  
 >      t = kmalloc(sizeof *t, GFP_KERNEL);
 >      if (!t) {

Seems you are replacing kcalloc with vmalloc, but I don't see anything
that clears the memory you allocate.

 > +    priv->cm.srq_ring = vmalloc(ipoib_recvq_size * sizeof 
 > *priv->cm.srq_ring);
 > +
 >      if (!priv->cm.srq_ring) {
 >              printk(KERN_WARNING "%s: failed to allocate CM SRQ ring (%d 
 > entries)\n",
 >                     priv->ca->name, ipoib_recvq_size);
 >              ib_destroy_srq(priv->cm.srq);
 >              priv->cm.srq = NULL;
 >      }
 > +    memset(priv->cm.srq_ring, 0, 
 > +                    ipoib_recvq_size * sizeof *priv->cm.srq_ring);

And here it seems if the allocation fail, you go on to zero out the ring
anyway.  (Not to mention trailing whitespace on the memset line :)

 - R.
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to