All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: afleming@freescale.com
Cc: jeff@garzik.org, galak@kernel.crashing.org, netdev@vger.kernel.org
Subject: Re: [PATCH v2.6.29 02/14] gianfar: Fix skb allocation error
Date: Tue, 16 Dec 2008 15:28:15 -0800 (PST)	[thread overview]
Message-ID: <20081216.152815.55433113.davem@davemloft.net> (raw)
In-Reply-To: <1229469667-25002-3-git-send-email-afleming@freescale.com>

From: Andy Fleming <afleming@freescale.com>
Date: Tue, 16 Dec 2008 17:20:55 -0600

> We don't want to unmap the skb if we've decided to use the old one, so we only
> unmap it if we're *not* using the old one.
> 
> Signed-off-by: Andy Fleming <afleming@freescale.com>

This does not apply to net-next-2.6, the code in this area doesn't
look anything like the context in this patch.  What are you
generating this against?

> @@ -1659,8 +1659,7 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)
>  
>  			if (unlikely(!newskb))
>  				newskb = skb;
> -
> -			if (skb) {
> +			else if (skb) {
>  				dma_unmap_single(&priv->dev->dev,
>  						bdp->bufPtr,
>  						priv->rx_buffer_size,

That code reads:

			if (unlikely(!newskb))
				newskb = skb;

			if (skb)
				dev_kfree_skb_any(skb);

in my tree and the dma_unmap_single() is unconditionally executed
further up before the:

		/* We drop the frame if we failed to allocate a new buffer */
		if (unlikely(!newskb || !(bdp->status & RXBD_LAST) ||
				 bdp->status & RXBD_ERR)) {

check.

Please sort this out and be more careful in the future.

Thanks.

  parent reply	other threads:[~2008-12-16 23:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-16 23:20 [PATCH 0/14] gianfar improvements Andy Fleming
2008-12-16 23:20 ` [PATCH v2.6.29 01/14] gianfar: Use gfar_halt to stop DMA in gfar_probe Andy Fleming
2008-12-16 23:20   ` [PATCH v2.6.29 02/14] gianfar: Fix skb allocation error Andy Fleming
2008-12-16 23:20     ` [PATCH v2.6.29 03/14] gianfar: Convert gianfar to an of_platform_driver Andy Fleming
2008-12-16 23:20       ` [PATCH v2.6.29 04/14] gianfar: Optimize interrupt coalescing configuration Andy Fleming
2008-12-16 23:20         ` [PATCH v2.6.29 05/14] gianfar: Fix eTSEC configuration procedure Andy Fleming
2008-12-16 23:20           ` [PATCH v2.6.29 06/14] gianfar: Fix VLAN HW feature related frame/buffer size calculation Andy Fleming
2008-12-16 23:21             ` [PATCH v2.6.29 07/14] gianfar: Enable padding and Optimize the frame prepended bytes handling Andy Fleming
2008-12-16 23:21               ` [PATCH v2.6.29 08/14] gianfar: Remove unused gfar_add_fcb() function parameter Andy Fleming
2008-12-16 23:21                 ` [PATCH v2.6.29 09/14] gianfar: Add macros for stepping through BDs Andy Fleming
2008-12-16 23:21                   ` [PATCH v2.6.29 10/14] gianfar: Make all BD status writes 32-bit Andy Fleming
2008-12-16 23:21                     ` [PATCH v2.6.29 11/14] gianfar: Add Scatter Gather support Andy Fleming
2008-12-16 23:21                       ` [PATCH v2.6.29 12/14] gianfar: Use interface name in interrupt name to distinguish the source Andy Fleming
2008-12-16 23:21                         ` [PATCH v2.6.29 13/14] gianfar: Merge Tx and Rx interrupt for scheduling clean up ring Andy Fleming
2008-12-16 23:21                           ` [PATCH v2.6.29 14/14] gianfar: Continue polling until both tx and rx are empty Andy Fleming
2008-12-16 23:36                       ` [PATCH v2.6.29 11/14] gianfar: Add Scatter Gather support David Miller
2008-12-16 23:35                     ` [PATCH v2.6.29 10/14] gianfar: Make all BD status writes 32-bit David Miller
2008-12-16 23:33                   ` [PATCH v2.6.29 09/14] gianfar: Add macros for stepping through BDs David Miller
2008-12-16 23:33                 ` [PATCH v2.6.29 08/14] gianfar: Remove unused gfar_add_fcb() function parameter David Miller
2008-12-16 23:31               ` [PATCH v2.6.29 07/14] gianfar: Enable padding and Optimize the frame prepended bytes handling David Miller
2008-12-16 23:30             ` [PATCH v2.6.29 06/14] gianfar: Fix VLAN HW feature related frame/buffer size calculation David Miller
2008-12-16 23:30           ` [PATCH v2.6.29 05/14] gianfar: Fix eTSEC configuration procedure David Miller
2008-12-16 23:30         ` [PATCH v2.6.29 04/14] gianfar: Optimize interrupt coalescing configuration David Miller
2008-12-16 23:29       ` [PATCH v2.6.29 03/14] gianfar: Convert gianfar to an of_platform_driver David Miller
2008-12-16 23:28     ` David Miller [this message]
2008-12-16 23:25   ` [PATCH v2.6.29 01/14] gianfar: Use gfar_halt to stop DMA in gfar_probe David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081216.152815.55433113.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=afleming@freescale.com \
    --cc=galak@kernel.crashing.org \
    --cc=jeff@garzik.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.