Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753290AbbD1C5N (ORCPT ); Mon, 27 Apr 2015 22:57:13 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:60500 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752859AbbD1C5L (ORCPT ); Mon, 27 Apr 2015 22:57:11 -0400 Date: Mon, 27 Apr 2015 22:57:09 -0400 (EDT) Message-Id: <20150427.225709.1737864122610182544.davem@davemloft.net> To: kys@microsoft.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com Subject: Re: [PATCH net 1/1] hv_netvsc: Fix a bug in netvsc_start_xmit() From: David Miller In-Reply-To: <1430183690-24198-1-git-send-email-kys@microsoft.com> References: <1430183690-24198-1-git-send-email-kys@microsoft.com> X-Mailer: Mew version 6.6 on Emacs 24.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 27 Apr 2015 19:57:11 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 900 Lines: 22 From: "K. Y. Srinivasan" Date: Mon, 27 Apr 2015 18:14:50 -0700 > Commit commit b08cc79155fc26d0d112b1470d1ece5034651a4b eliminated memory > allocation in the packet send path. This commit introduced a bug since it > did not account for the case if the skb was cloned. Fix this bug by > using the pre-reserved head room only if the skb is not cloned. > > Signed-off-by: K. Y. Srinivasan We have generic infrastructure to do this, please try instead: err = skb_cow_head(skb, pkt_sz); this will take care of everything for you and you can get rid of all of this dynamic memory allocation etc. in this code path. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/