summaryrefslogtreecommitdiff
path: root/notifier.c
diff options
context:
space:
mode:
Diffstat (limited to 'notifier.c')
-rw-r--r--notifier.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/notifier.c b/notifier.c
index 7f9712d..01dd768 100644
--- a/notifier.c
+++ b/notifier.c
@@ -18,16 +18,20 @@ static int up_event_handler(struct wlan_ptracker_core *core, struct net_device *
{
core->dev = dev;
core->client->core = core;
+ dev_hold(dev);
core->client->priv = dev;
return tp_monitor_init(&core->tp);
}
static void down_event_handler(struct wlan_ptracker_core *core)
{
+ struct net_device *dev = core->dev;
tp_monitor_exit(&core->tp);
core->dev = NULL;
core->client->core = NULL;
core->client->priv = NULL;
+ if (dev)
+ dev_put(dev);
}
static int netdevice_notifier_handler(struct notifier_block *nb,