public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-net-drivers@solarflare.com>
Subject: [PATCH net-next 06/10] sfc: Use dev_kfree_skb() in efx_end_loopback()
Date: Tue, 17 Jul 2012 19:06:55 +0100	[thread overview]
Message-ID: <1342548415.2698.24.camel@bwh-desktop.uk.solarflarecom.com> (raw)
In-Reply-To: <1342544740.2698.13.camel@bwh-desktop.uk.solarflarecom.com>

Fix CID 102619 in the Coverity report on Linux.

efx_end_loopback() iterates over an array of skb pointers of which
some may be null (if efx_begin_loopback() failed).  It should not use
dev_kfree_skb_irq(), which requires non-null pointers.  In practice
this is safe because it does not run in interrupt context and
therefore always ends up calling dev_kfree_skb(), which does allow
null pointers.  But we should make that explicit.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/ethernet/sfc/selftest.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/sfc/selftest.c b/drivers/net/ethernet/sfc/selftest.c
index de4c006..ccc428f 100644
--- a/drivers/net/ethernet/sfc/selftest.c
+++ b/drivers/net/ethernet/sfc/selftest.c
@@ -488,7 +488,7 @@ static int efx_end_loopback(struct efx_tx_queue *tx_queue,
 		skb = state->skbs[i];
 		if (skb && !skb_shared(skb))
 			++tx_done;
-		dev_kfree_skb_any(skb);
+		dev_kfree_skb(skb);
 	}
 
 	netif_tx_unlock_bh(efx->net_dev);
-- 
1.7.7.6



-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

  parent reply	other threads:[~2012-07-17 18:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-17 17:05 pull request: sfc-next 2012-07-17 Ben Hutchings
2012-07-17 17:31 ` David Miller
2012-07-17 18:03   ` Ben Hutchings
2012-07-17 18:05 ` [PATCH net-next 01/10] sfc: Work around bogus 'uninitialised variable' warning Ben Hutchings
2012-07-17 18:05 ` [PATCH net-next 02/10] sfc: Use generic DMA API, not PCI-DMA API Ben Hutchings
2012-07-17 18:06 ` [PATCH net-next 03/10] sfc: Remove dead write to tso_state::packet_space Ben Hutchings
2012-07-17 18:06 ` [PATCH net-next 04/10] sfc: Stop changing header offsets on TX Ben Hutchings
2012-07-17 18:06 ` [PATCH net-next 05/10] sfc: Use strlcpy() to copy ethtool stats names Ben Hutchings
2012-07-17 18:06 ` Ben Hutchings [this message]
2012-07-17 18:07 ` [PATCH net-next 07/10] sfc: Explain why efx_mcdi_exit_assertion() ignores result of efx_mcdi_rpc() Ben Hutchings
2012-07-17 18:07 ` [PATCH net-next 08/10] sfc: Disable VF queues during register self-test Ben Hutchings
2012-07-17 18:07 ` [PATCH net-next 09/10] sfc: Fix interface statistics running backward Ben Hutchings
2012-07-17 18:07 ` [PATCH net-next 10/10] sfc: Correct some comments on enum reset_type Ben Hutchings
2012-07-18 16:10 ` pull request: sfc-next 2012-07-17 David Miller
2012-07-18 16:19   ` Ben Hutchings

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=1342548415.2698.24.camel@bwh-desktop.uk.solarflarecom.com \
    --to=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=linux-net-drivers@solarflare.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox