From patchwork Tue May 12 06:06:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 6385861 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F2FCBBEEE1 for ; Tue, 12 May 2015 06:08:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D51720395 for ; Tue, 12 May 2015 06:08:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5DB8E20328 for ; Tue, 12 May 2015 06:08:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ys3L2-0004H5-Hg; Tue, 12 May 2015 06:06:44 +0000 Received: from mail-wi0-f177.google.com ([209.85.212.177]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ys3Ky-0004AN-FA for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2015 06:06:41 +0000 Received: by wizk4 with SMTP id k4so136466285wiz.1 for ; Mon, 11 May 2015 23:06:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=p5MpruHhzfeG5MKfxJ6iviu100kYnqxniJycdppoFt0=; b=gF1pj2wZ8H6kn6SHSjXQ+kkJGrJsQ+GfITske/hqnqH5x7NMI/3YKAqP+y/WU2xuE0 Gt1wi4KGEdFOp2ZU2k81itFS3LxCNpZzZm2TK/4mOSS9c3msOCLeDNOgNuTufJuU0uZ8 4doasgogXoIQ/awTLjwr8vvfwGQ9IVSGrTS0gyYthAkXW9lRX7QU3AOkU7O4Amf4vCkL OH7N9pq20sD3TXKe2qhrhZPNGL79fgUfQw6cBtgtAFyEFxcTJV2uNcqmbsxfv8UcCx5r CcEOLKf3ms7tLyXMTxMnNJMuBAqqCa+f2gxuhFihu/UYkxU0eODy+I6vSCqNbcgV4eus 78sw== X-Gm-Message-State: ALoCoQlqO8iF8HiHlNzYAtaTU+ow0umKhEsFGBzkoPpLBcCJqaCG7j4py8CTXfivmo4Mco6jPZvX X-Received: by 10.180.82.73 with SMTP id g9mr6044889wiy.87.1431410777782; Mon, 11 May 2015 23:06:17 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by mx.google.com with ESMTPSA id ei8sm25978058wjd.32.2015.05.11.23.06.16 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 11 May 2015 23:06:16 -0700 (PDT) From: Michal Simek To: netdev@vger.kernel.org Subject: [PATCH v2] net: ll_temac: Fix DMA map size bug Date: Tue, 12 May 2015 08:06:15 +0200 Message-Id: <66b8efd7a63674220d55a03d0220897bd8b8712b.1431410769.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.3.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150511_230640_673900_FC5BF706 X-CRM114-Status: GOOD ( 10.81 ) X-Spam-Score: -0.7 (/) Cc: Subbaraya Sundeep Bhatta , monstr@monstr.eu, linux-kernel@vger.kernel.org, Markus Elfring , Fabian Frederick , Julia Lawall , =?UTF-8?q?Manuel=20Sch=C3=B6lling?= , "David S. Miller" , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP DMA allocates skb->len instead of headlen which is used for DMA. Signed-off-by: Michal Simek --- Changes in v2: - Align the later argument with the right side of the parenthesis Reported-by: Julia Lawall drivers/net/ethernet/xilinx/ll_temac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c index ca640d04fd93..3b99a4df71f8 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c @@ -705,8 +705,8 @@ static int temac_start_xmit(struct sk_buff *skb, struct net_device *ndev) cur_p->app0 |= STS_CTRL_APP0_SOP; cur_p->len = skb_headlen(skb); - cur_p->phys = dma_map_single(ndev->dev.parent, skb->data, skb->len, - DMA_TO_DEVICE); + cur_p->phys = dma_map_single(ndev->dev.parent, skb->data, + skb_headlen(skb), DMA_TO_DEVICE); cur_p->app4 = (unsigned long)skb; for (ii = 0; ii < num_frag; ii++) {