lkml.org 
[lkml]   [2015]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net: moxa: fix TX overrun memory leak
From
From: Jonas Jensen <jonas.jensen@gmail.com>
Date: Fri, 5 Jun 2015 15:46:18 +0200

> desc = priv->tx_desc_base + (TX_REG_DESC_SIZE * tx_head);
>
> - spin_lock_irq(&priv->txlock);
> + if (CIRC_SPACE(tx_head, tx_tail, TX_DESC_NUM) == 0) {
> + priv->stats.tx_dropped++;
> + goto out_unlock;
> + }

You can't do this.

Whatever code creates this condition _must_ stop the TX queue
so that the core netdevice transmit layer does not call your
transmit method.


\
 
 \ /
  Last update: 2015-06-08 04:41    [W:0.051 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site