]> git.baikalelectronics.ru Git - kernel.git/commit
net_sched: properly check for empty skb array on error path
authorCong Wang <xiyou.wangcong@gmail.com>
Mon, 18 Dec 2017 22:34:26 +0000 (14:34 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Dec 2017 19:13:12 +0000 (14:13 -0500)
commit76d6b0f4b1e3e9a0411c0b1c02c3eec2b9da6bd4
tree443baff71ebce34735a8c765852330e6e77f3821
parent1d181fbb5443ee5fc0da5c2ebde1090dfb8aefa3
net_sched: properly check for empty skb array on error path

First, the check of &q->ring.queue against NULL is wrong, it
is always false. We should check the value rather than the address.

Secondly, we need the same check in pfifo_fast_reset() too,
as both ->reset() and ->destroy() are called in qdisc_destroy().

Fixes: 0ad787760556 ("net: sched: pfifo_fast use skb_array")
Reported-by: syzbot <syzkaller@googlegroups.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_generic.c