Commit 4fbacf3c authored by Niklas Cassel's avatar Niklas Cassel Committed by Khasim Syed Mohammed
Browse files

UPSTREAM: net: stmmac: WARN if tx_skbuff entries are reused before cleared



The current code assumes that a tx_skbuff entry has been cleared
by stmmac_tx_clean() before stmmac_xmit()/stmmac_tso_xmit()
assigns a new skb to that entry. However, since we never check
the current value before overwriting it, it is theoretically
possible that a non-NULL value is overwritten.

Add WARN_ONs to verify that each entry in tx_skbuff is NULL
before it is assigned a new value.

Signed-off-by: default avatarNiklas Cassel <niklas.cassel@axis.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
(cherry picked from commit b4c9784c
https://github.com/torvalds/linux.git

)
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent a20f3350
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment