aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorCong Wang <xiyou.wangcong@gmail.com>2018-01-15 11:37:29 -0800
committerDavid S. Miller <davem@davemloft.net>2018-01-17 15:08:28 -0500
commit4df0bfc79904b7169dc77dcce44598b1545721f9 (patch)
treece8bf71d496ff40700ae04f47287680e01d4f9cf /drivers/net/usb
parentMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma (diff)
downloadlinux-dev-4df0bfc79904b7169dc77dcce44598b1545721f9.tar.xz
linux-dev-4df0bfc79904b7169dc77dcce44598b1545721f9.zip
tun: fix a memory leak for tfile->tx_array
tfile->tun could be detached before we close the tun fd, via tun_detach_all(), so it should not be used to check for tfile->tx_array. As Jason suggested, we probably have to clean it up unconditionally both in __tun_deatch() and tun_detach_all(), but this requires to check if it is initialized or not. Currently skb_array_cleanup() doesn't have such a check, so I check it in the caller and introduce a helper function, it is a bit ugly but we can always improve it in net-next. Reported-by: Dmitry Vyukov <dvyukov@google.com> Fixes: 1576d9860599 ("tun: switch to use skb array for tx") Cc: Jason Wang <jasowang@redhat.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
0 files changed, 0 insertions, 0 deletions