Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966382AbcCPIcX (ORCPT ); Wed, 16 Mar 2016 04:32:23 -0400 Received: from mail.kernel.org ([198.145.29.136]:59828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966232AbcCPIJx (ORCPT ); Wed, 16 Mar 2016 04:09:53 -0400 From: lizf@kernel.org To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Jiri Pirko , "David S. Miller" , Zefan Li Subject: [PATCH 3.4 049/107] niu: don't count tx error twice in case of headroom realloc fails Date: Wed, 16 Mar 2016 16:05:43 +0800 Message-Id: <1458115601-5762-49-git-send-email-lizf@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1458115541-5712-1-git-send-email-lizf@kernel.org> References: <1458115541-5712-1-git-send-email-lizf@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 963 Lines: 35 From: Jiri Pirko 3.4.111-rc1 review patch. If anyone has any objections, please let me know. ------------------ commit 42288830494cd51873ca745a7a229023df061226 upstream. Fixes: a3138df9 ("[NIU]: Add Sun Neptune ethernet driver.") Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller Signed-off-by: Zefan Li --- drivers/net/ethernet/sun/niu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index 8489d09..e475f85 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c @@ -6659,10 +6659,8 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb, struct sk_buff *skb_new; skb_new = skb_realloc_headroom(skb, len); - if (!skb_new) { - rp->tx_errors++; + if (!skb_new) goto out_drop; - } kfree_skb(skb); skb = skb_new; } else -- 1.9.1