From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756838AbdEHUBw convert rfc822-to-8bit (ORCPT ); Mon, 8 May 2017 16:01:52 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:37578 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754140AbdEHUBu (ORCPT ); Mon, 8 May 2017 16:01:50 -0400 Date: Mon, 08 May 2017 16:01:48 -0400 (EDT) Message-Id: <20170508.160148.1055084315233926966.davem@davemloft.net> To: jim_baxter@mentor.com Cc: linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, oliver@neukum.org Subject: Re: [PATCH V2 1/1] net: cdc_ncm: Fix TX zero padding From: David Miller In-Reply-To: <1494247797-1732-2-git-send-email-jim_baxter@mentor.com> References: <1494247797-1732-1-git-send-email-jim_baxter@mentor.com> <1494247797-1732-2-git-send-email-jim_baxter@mentor.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 08 May 2017 12:20:21 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jim Baxter Date: Mon, 8 May 2017 13:49:57 +0100 > The zero padding that is added to NTB's does > not zero the memory correctly. > This is because the skb_put modifies the value > of skb_out->len which results in the memset > command not setting any memory to zero as > (ctx->tx_max - skb_out->len) == 0. > > I have resolved this by storing the size of > the memory to be zeroed before the skb_put > and using this in the memset call. > > Signed-off-by: Jim Baxter > Reviewed-by: Bjørn Mork Applied, thank you.