From: Cong Wang <xiyou.wangcong@xxxxxxxxx>
commit b9a1e627405d68d475a3c1f35e685ccfb5bbe668 upstream.
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@xxxxxxxxxxxxxxxxxxxxxxxxx
Cc: Arvid Brodin <arvid.brodin@xxxxxxxx>
Signed-off-by: Cong Wang <xiyou.wangcong@xxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>