From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH] arc_emac: fix Date: Thu, 19 Dec 2013 18:05:15 -0800 Message-ID: <1387505115.19078.417.camel@edumazet-glaptop2.roam.corp.google.com> References: <1387504737.19078.416.camel@edumazet-glaptop2.roam.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: netdev , Alexey Brodkin , Richard Cochran To: David Miller Return-path: Received: from mail-pa0-f44.google.com ([209.85.220.44]:57523 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755875Ab3LTCFR (ORCPT ); Thu, 19 Dec 2013 21:05:17 -0500 Received: by mail-pa0-f44.google.com with SMTP id fa1so1971589pad.17 for ; Thu, 19 Dec 2013 18:05:16 -0800 (PST) In-Reply-To: <1387504737.19078.416.camel@edumazet-glaptop2.roam.corp.google.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 2013-12-19 at 17:58 -0800, Eric Dumazet wrote: > Signed-off-by: Eric Dumazet > > skb_tx_timestamp(skb) should be called _before_ TX completion > has a chance to trigger, otherwise it is too late and we access > freed memory. > > Fixes: e4f2379db6c6 ("ethernet/arc/arc_emac - Add new driver") > From: Eric Dumazet > Cc: Alexey Brodkin > Cc: Richard Cochran > --- > drivers/net/ethernet/arc/emac_main.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c > index b2ffad1304d2..248baf6273fb 100644 > --- a/drivers/net/ethernet/arc/emac_main.c > +++ b/drivers/net/ethernet/arc/emac_main.c > @@ -565,6 +565,8 @@ static int arc_emac_tx(struct sk_buff *skb, struct net_device *ndev) > /* Make sure pointer to data buffer is set */ > wmb(); > > + skb_tx_timestamp(skb); > + > *info = cpu_to_le32(FOR_EMAC | FIRST_OR_LAST_MASK | len); > > /* Increment index to point to the next BD */ > @@ -579,8 +581,6 @@ static int arc_emac_tx(struct sk_buff *skb, struct net_device *ndev) > > arc_reg_set(priv, R_STATUS, TXPL_MASK); > > - skb_tx_timestamp(skb); > - > return NETDEV_TX_OK; > } > Sorry I messed patch title, will resend