diff options
author | Sven Eckelmann <sven.eckelmann@gmx.de> | 2010-08-21 08:18:08 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-23 21:15:37 -0400 |
commit | 1189f130f89b73eecb6117c0fc5e90abbcb7faa0 (patch) | |
tree | 2e3ea12db94b79a177c86727a50c674d9b504324 | |
parent | 51e21ae3d79e608022271f91166c84bd0e9fb8b8 (diff) |
Staging: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/batman-adv/hard-interface.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/batman-adv/hard-interface.c b/drivers/staging/batman-adv/hard-interface.c index f6345c465eb3..892166b86dd8 100644 --- a/drivers/staging/batman-adv/hard-interface.c +++ b/drivers/staging/batman-adv/hard-interface.c | |||
@@ -393,15 +393,13 @@ static int hard_if_event(struct notifier_block *this, | |||
393 | /* FIXME: each batman_if will be attached to a softif */ | 393 | /* FIXME: each batman_if will be attached to a softif */ |
394 | struct bat_priv *bat_priv = netdev_priv(soft_device); | 394 | struct bat_priv *bat_priv = netdev_priv(soft_device); |
395 | 395 | ||
396 | if (!batman_if) | 396 | if (!batman_if && event == NETDEV_REGISTER) |
397 | batman_if = hardif_add_interface(net_dev); | 397 | batman_if = hardif_add_interface(net_dev); |
398 | 398 | ||
399 | if (!batman_if) | 399 | if (!batman_if) |
400 | goto out; | 400 | goto out; |
401 | 401 | ||
402 | switch (event) { | 402 | switch (event) { |
403 | case NETDEV_REGISTER: | ||
404 | break; | ||
405 | case NETDEV_UP: | 403 | case NETDEV_UP: |
406 | hardif_activate_interface(soft_device, bat_priv, batman_if); | 404 | hardif_activate_interface(soft_device, bat_priv, batman_if); |
407 | break; | 405 | break; |