]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: don't access unregistered net_device object
authorAntonio Quartulli <antonio@meshcoding.com>
Tue, 4 Aug 2015 20:26:19 +0000 (22:26 +0200)
committerAntonio Quartulli <antonio@meshcoding.com>
Thu, 27 Aug 2015 18:15:33 +0000 (20:15 +0200)
commit0b4cab5a32b95776ed5c58952f1cd88b0503dbf6
treeb85fb2810f6855173f81868d768d1ba91a0c8bc1
parentdedacc518c4c56983fc0e5d36644001f4c356d0c
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 <antonio@meshcoding.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
net/batman-adv/hard-interface.c