From patchwork Mon Mar 30 04:08:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KY Srinivasan X-Patchwork-Id: 455969 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 404B1140161 for ; Mon, 30 Mar 2015 13:52:01 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752832AbbC3Cvh (ORCPT ); Sun, 29 Mar 2015 22:51:37 -0400 Received: from p3plsmtps2ded04.prod.phx3.secureserver.net ([208.109.80.198]:36206 "EHLO p3plsmtps2ded04.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752647AbbC3Cvf (ORCPT ); Sun, 29 Mar 2015 22:51:35 -0400 Received: from linuxonhyperv.com ([72.167.245.219]) by p3plsmtps2ded04.prod.phx3.secureserver.net with : DED : id 9era1q02J4kklxU01erayg; Sun, 29 Mar 2015 19:51:35 -0700 x-originating-ip: 72.167.245.219 Received: by linuxonhyperv.com (Postfix, from userid 507) id EDCC4190838; Sun, 29 Mar 2015 21:08:43 -0700 (PDT) From: "K. Y. Srinivasan" To: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com Cc: "K. Y. Srinivasan" Subject: [PATCH net-next 1/2] hv_netvsc: Cleanup the test for freeing skb when we use sendbuf mechanism Date: Sun, 29 Mar 2015 21:08:41 -0700 Message-Id: <1427688522-27991-1-git-send-email-kys@microsoft.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1427688478-27950-1-git-send-email-kys@microsoft.com> References: <1427688478-27950-1-git-send-email-kys@microsoft.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In preparation for embedding the rndis state and other packet state into the skb, cleanup the test for freeing the skb. Signed-off-by: K. Y. Srinivasan --- drivers/net/hyperv/netvsc.c | 1 + drivers/net/hyperv/netvsc_drv.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index b81bd37..ecbd813 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -870,6 +870,7 @@ int netvsc_send(struct hv_device *device, (unsigned long)packet->send_completion_tid; packet->page_buf_cnt = 0; + packet->send_completion_tid = 0; packet->send_buf_index = section_index; packet->total_data_buflen += msd_len; diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 0c99818..75beb89 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -234,11 +234,10 @@ static void netvsc_xmit_completion(void *context) struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context; struct sk_buff *skb = (struct sk_buff *) (unsigned long)packet->send_completion_tid; - u32 index = packet->send_buf_index; kfree(packet); - if (skb && (index == NETVSC_INVALID_INDEX)) + if (skb) dev_kfree_skb_any(skb); }