hsr: implement dellink to clean up resources
authorCong Wang <xiyou.wangcong@gmail.com>
Thu, 4 Jul 2019 00:21:13 +0000 (17:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Jul 2019 22:22:27 +0000 (15:22 -0700)
commitb9a1e627405d68d475a3c1f35e685ccfb5bbe668
tree4130c796a3b6477e01126514e08f9cb2fc91f4b6
parent619afef01f74f3572b5e9a266c1230dc83761eec
hsr: implement dellink to clean up resources

hsr_link_ops implements ->newlink() but not ->dellink(),
which leads that resources not released after removing the device,
particularly the entries in self_node_db and node_db.

So add ->dellink() implementation to replace the priv_destructor.
This also makes the code slightly easier to understand.

Reported-by: syzbot+c6167ec3de7def23d1e8@syzkaller.appspotmail.com
Cc: Arvid Brodin <arvid.brodin@alten.se>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/hsr/hsr_device.c
net/hsr/hsr_device.h
net/hsr/hsr_framereg.c
net/hsr/hsr_framereg.h
net/hsr/hsr_netlink.c