batman-adv: don't access unregistered net_device object
batman-adv: don't access unregistered net_device object

In batadv_hardif_disable_interface() there is a call to
batadv_softif_destroy_sysfs() which in turns invokes
unregister_netdevice() on the soft_iface.
After this point we cannot rely on the soft_iface object
anymore because it might get free'd by the netdev periodic
routine at any time.

For this reason the netdev_upper_dev_unlink(.., soft_iface) call
is moved before the invocation of batadv_softif_destroy_sysfs() so
that we can be sure that the soft_iface object is still valid.

Signed-off-by: Antonio Quartulli <a08f08bac39aeae6c9580ade7aa8387b5a0e7428@meshcoding.com>
Signed-off-by: Marek Lindner <5760fd64db566c47bfb7ce809fea1d3e512880cf@neomailbox.ch>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs