On Wed,  2 Dec 2020 16:59:48 +0800 Joakim Zhang wrote:
> From: Fugang Duan <fugang.d...@nxp.com>
> 
> When do suspend/resume test, there have WARN_ON() log dump from
> stmmac_xmit() funciton, the code logic:
>       entry = tx_q->cur_tx;
>       first_entry = entry;
>       WARN_ON(tx_q->tx_skbuff[first_entry]);
> 
> In normal case, tx_q->tx_skbuff[txq->cur_tx] should be NULL because
> the skb should be handled and freed in stmmac_tx_clean().
> 
> But stmmac_resume() reset queue parameters like below, skb buffers
> may not be freed.
>       tx_q->cur_tx = 0;
>       tx_q->dirty_tx = 0;
> 
> So free tx skb buffer in stmmac_resume() to avoid warning and
> memory leak.

Also needs Fixes

Reply via email to