Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752509AbdLSQlG (ORCPT ); Tue, 19 Dec 2017 11:41:06 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:53122 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751869AbdLSQlC (ORCPT ); Tue, 19 Dec 2017 11:41:02 -0500 Date: Tue, 19 Dec 2017 11:41:00 -0500 (EST) Message-Id: <20171219.114100.723259287206961093.davem@davemloft.net> To: al.kochet@gmail.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, f.fainelli@gmail.com, edumazet@google.com Subject: Re: [PATCH] net: arc_emac: fix arc_emac_rx() error paths From: David Miller In-Reply-To: References: <1513358406-32503-1-git-send-email-al.kochet@gmail.com> <20171219.102254.1959679351283055093.davem@davemloft.net> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-7 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 19 Dec 2017 08:41:01 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id vBJGfA6q017251 Content-Length: 622 Lines: 15 From: Alexander Kochetkov Date: Tue, 19 Dec 2017 18:49:48 +0300 >> And then you unmap it. "addr" is the new DMA mapping, not the old one. > > The old mapping should be unmapped here. It refer to old skb what contains already > received packet. Because buffer doesn?t belong to EMAC anymore. > That old mapping point to old skb buffer. And netif_receive_skb() will be > called for old skb after that. I misread the code, sorry. I saw the dma_unmap_addr(xxx, addr) and just considered 'addr' as the local variable. It's not, it's in fact the TX struct member. Let me look at this some more. ;-)