mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
bnx2x: Prevent null pointer dereference on SKB release
On error flows its possible to free an SKB even if it was not allocated. Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
21a447637d
commit
e1615903eb
1 changed files with 1 additions and 1 deletions
|
@ -262,9 +262,9 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata,
|
||||||
if (likely(skb)) {
|
if (likely(skb)) {
|
||||||
(*pkts_compl)++;
|
(*pkts_compl)++;
|
||||||
(*bytes_compl) += skb->len;
|
(*bytes_compl) += skb->len;
|
||||||
|
dev_kfree_skb_any(skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
dev_kfree_skb_any(skb);
|
|
||||||
tx_buf->first_bd = 0;
|
tx_buf->first_bd = 0;
|
||||||
tx_buf->skb = NULL;
|
tx_buf->skb = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue