]> git.baikalelectronics.ru Git - kernel.git/commit
tun: avoid calling xdp_rxq_info_unreg() twice
authorCong Wang <xiyou.wangcong@gmail.com>
Mon, 22 Jan 2018 21:49:27 +0000 (13:49 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Jan 2018 21:55:18 +0000 (16:55 -0500)
commit144b234394874146a82a54007858df5da81d8209
treea14a3cf60f7ebaed363046c62a89ad942405ff15
parentd28a56e6f4cd833f5e931d754cb1f4af54947e8b
tun: avoid calling xdp_rxq_info_unreg() twice

Similarly to tx ring, xdp_rxq_info is only registered
when !tfile->detached, so we need to avoid calling
xdp_rxq_info_unreg() twice too. The helper tun_cleanup_tx_ring()
already checks for this properly, so it is correct to put
xdp_rxq_info_unreg() just inside there.

Reported-by: syzbot+1c788d7ce0f0888f1d7f@syzkaller.appspotmail.com
Fixes: 69b48127dcc3 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net")
Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c