From patchwork Tue Jan 12 11:01:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 42707 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 774E61007D6 for ; Tue, 12 Jan 2010 22:04:25 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754110Ab0ALLET (ORCPT ); Tue, 12 Jan 2010 06:04:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754043Ab0ALLET (ORCPT ); Tue, 12 Jan 2010 06:04:19 -0500 Received: from ozlabs.org ([203.10.76.45]:56436 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754033Ab0ALLET (ORCPT ); Tue, 12 Jan 2010 06:04:19 -0500 Received: by ozlabs.org (Postfix, from userid 1010) id E37291007D4; Tue, 12 Jan 2010 22:04:17 +1100 (EST) Date: Tue, 12 Jan 2010 22:01:35 +1100 From: Anton Blanchard To: Jeff Kirsher , Jesse Brandeburg , Bruce Allan , PJ Waskiewicz , John Ronciak , Don Skidmore , Yi Zou , Alexander Duyck Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org Subject: [PATCH] ixgbe: Fix ixgbe_tx_map error path Message-ID: <20100112110135.GK12666@kryten> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Commit e5a43549f7a58509a91b299a51337d386697b92c (ixgbe: remove skb_dma_map/unmap calls from driver) looks to have introduced a bug in ixgbe_tx_map. If we get an error from a PCI DMA call, we loop backwards through count until it becomes -1 and return that. The caller of ixgbe_tx_map expects 0 on error, so return that instead. --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 1a2ea62..af660ba 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c @@ -5174,7 +5174,7 @@ dma_error: ixgbe_unmap_and_free_tx_resource(adapter, tx_buffer_info); } - return count; + return 0; } static void ixgbe_tx_queue(struct ixgbe_adapter *adapter,