[openib-general] [PATCH]memory leak in ipoib_ib_post_receive()

Roland Dreier roland at topspin.com
Wed Feb 9 08:49:30 PST 2005


    Shirley> Here is the patch.

Thanks, good catch.  Unfortunately your patch got whitespace-mangled
somewhere along the way.  Also I think we also need to undo the DMA
mapping in addition to freeing the skb, like this:

Index: infiniband/ulp/ipoib/ipoib_ib.c
===================================================================
--- infiniband/ulp/ipoib/ipoib_ib.c	(revision 1758)
+++ infiniband/ulp/ipoib/ipoib_ib.c	(working copy)
@@ -137,6 +137,9 @@ static int ipoib_ib_post_receive(struct 
 	if (ret) {
 		ipoib_warn(priv, "ipoib_ib_receive failed for buf %d (%d)\n",
 			   id, ret);
+		dma_unmap_single(priv->ca->dma_device, addr,
+				 IPOIB_BUF_SIZE, DMA_FROM_DEVICE);
+		dev_kfree_skb_any(skb);
 		priv->rx_ring[id].skb = NULL;
 	}
 




More information about the general mailing list