Author: marek Date: 2010-08-20 21:16:00 +0200 (Fri, 20 Aug 2010) New Revision: 1769
Modified: trunk/batman-adv/hard-interface.c Log: batman-adv: Create batman_if only on register event
We try to get all events for all net_devices to be able to add special sysfs folders for the batman-adv configuration. This also includes such events like NETDEV_POST_INIT which has no valid kobject according to v2.6.32-rc3-13-g7ffbe3f. This would create an oops in that situation.
It is enough to create the batman_if only on NETDEV_REGISTER events because we will also receive those events for devices which already existed when we registered the notifier call.
Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de Cc: stable stable@kernel.org
Modified: trunk/batman-adv/hard-interface.c =================================================================== --- trunk/batman-adv/hard-interface.c 2010-08-09 22:10:42 UTC (rev 1768) +++ trunk/batman-adv/hard-interface.c 2010-08-20 19:16:00 UTC (rev 1769) @@ -457,15 +457,13 @@ struct batman_if *batman_if = get_batman_if_by_netdev(net_dev); struct bat_priv *bat_priv;
- if (!batman_if) - batman_if = hardif_add_interface(net_dev); + if (!batman_if && event == NETDEV_REGISTER) + batman_if = hardif_add_interface(net_dev);
if (!batman_if) goto out;
switch (event) { - case NETDEV_REGISTER: - break; case NETDEV_UP: hardif_activate_interface(batman_if); break;