diff options
author | alex.bluesman.smirnov@gmail.com <alex.bluesman.smirnov@gmail.com> | 2012-04-25 19:24:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-26 05:32:55 -0400 |
commit | 8deff4af8745561efd2be34ee30cc57a6f0107c6 (patch) | |
tree | d2b3aaa6d55258ff020687c50d4122e6aebef963 /net/ieee802154 | |
parent | 0848e4043014631d792a66266d6d7d64a7f21da5 (diff) |
6lowpan: clean up fragments list if module unloaded
Clean all the pending fragments and relative timers if 6lowpan link
is going to be deleted.
Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ieee802154')
-rw-r--r-- | net/ieee802154/6lowpan.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c index f6b169439b5b..b3021f765204 100644 --- a/net/ieee802154/6lowpan.c +++ b/net/ieee802154/6lowpan.c | |||
@@ -1177,11 +1177,20 @@ static void lowpan_dellink(struct net_device *dev, struct list_head *head) | |||
1177 | { | 1177 | { |
1178 | struct lowpan_dev_info *lowpan_dev = lowpan_dev_info(dev); | 1178 | struct lowpan_dev_info *lowpan_dev = lowpan_dev_info(dev); |
1179 | struct net_device *real_dev = lowpan_dev->real_dev; | 1179 | struct net_device *real_dev = lowpan_dev->real_dev; |
1180 | struct lowpan_dev_record *entry; | 1180 | struct lowpan_dev_record *entry, *tmp; |
1181 | struct lowpan_dev_record *tmp; | 1181 | struct lowpan_fragment *frame, *tframe; |
1182 | 1182 | ||
1183 | ASSERT_RTNL(); | 1183 | ASSERT_RTNL(); |
1184 | 1184 | ||
1185 | spin_lock(&flist_lock); | ||
1186 | list_for_each_entry_safe(frame, tframe, &lowpan_fragments, list) { | ||
1187 | del_timer(&frame->timer); | ||
1188 | list_del(&frame->list); | ||
1189 | dev_kfree_skb(frame->skb); | ||
1190 | kfree(frame); | ||
1191 | } | ||
1192 | spin_unlock(&flist_lock); | ||
1193 | |||
1185 | mutex_lock(&lowpan_dev_info(dev)->dev_list_mtx); | 1194 | mutex_lock(&lowpan_dev_info(dev)->dev_list_mtx); |
1186 | list_for_each_entry_safe(entry, tmp, &lowpan_devices, list) { | 1195 | list_for_each_entry_safe(entry, tmp, &lowpan_devices, list) { |
1187 | if (entry->ldev == dev) { | 1196 | if (entry->ldev == dev) { |