From patchwork Tue Apr 24 10:51:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alex.bluesman.smirnov@gmail.com X-Patchwork-Id: 154652 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DC800B6FED for ; Tue, 24 Apr 2012 20:51:53 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753124Ab2DXKvt (ORCPT ); Tue, 24 Apr 2012 06:51:49 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:54362 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752870Ab2DXKvk (ORCPT ); Tue, 24 Apr 2012 06:51:40 -0400 Received: by mail-bk0-f46.google.com with SMTP id w12so313849bku.19 for ; Tue, 24 Apr 2012 03:51:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=INXabW21AmXgBEgngA1rwrFdHRqKKJmypLyMUL+UGmg=; b=RPBRrLultix0A0Kom1YzOSm9R/dAobRBqHvV9ChMVchHwxo9VL08nBzbxgtr/3VKoj lSGfV5onTum5SaKEbnRiUfzuUmP1qa7CMxJfX3SUnVnK0EqnKNJ11S40ey6sERwUpS+n Uq0uKoQkaCteNk5mVrb0gRncDClIrdBeB4t7tHlj/h+R7HldHjRJ43AokzOe1uUq2tEM 5W2Jy/oh6I96WJPsqhIk1bB8viIcXrwLYQxPyU+BmkuFDi3HusRM8SlKl4y5ghVSczWn p18Xq65QKjdQNkmJqppPNVMKUmc2ndu9BfPJWUq1WsqE5bO+x6dQ6lzVbw6YzpbViUYh xFbg== Received: by 10.205.121.145 with SMTP id gc17mr1796066bkc.8.1335264699879; Tue, 24 Apr 2012 03:51:39 -0700 (PDT) Received: from localhost.localdomain ([91.213.169.4]) by mx.google.com with ESMTPS id s20sm30528929bks.2.2012.04.24.03.51.38 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Apr 2012 03:51:39 -0700 (PDT) From: Alexander Smirnov To: netdev@vger.kernel.org Cc: davem@davemloft.net, linux-zigbee-devel@lists.sourceforge.net, Alexander Smirnov Subject: [PATCH 3/5] 6lowpan: clean up fragments list if module unloaded Date: Tue, 24 Apr 2012 14:51:09 +0400 Message-Id: <1335264671-27127-4-git-send-email-alex.bluesman.smirnov@gmail.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1335264671-27127-1-git-send-email-alex.bluesman.smirnov@gmail.com> References: <1335264671-27127-1-git-send-email-alex.bluesman.smirnov@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Clean all the pending fragments and timers if 6lowpan link is going to be deleted. Signed-off-by: Alexander Smirnov --- 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 d440233..a57174e 100644 --- a/net/ieee802154/6lowpan.c +++ b/net/ieee802154/6lowpan.c @@ -1192,11 +1192,20 @@ static void lowpan_dellink(struct net_device *dev, struct list_head *head) { struct lowpan_dev_info *lowpan_dev = lowpan_dev_info(dev); struct net_device *real_dev = lowpan_dev->real_dev; - struct lowpan_dev_record *entry; - struct lowpan_dev_record *tmp; + struct lowpan_dev_record *entry, *tmp; + struct lowpan_fragment *frame, *tframe; ASSERT_RTNL(); + spin_lock(&flist_lock); + list_for_each_entry_safe(frame, tframe, &lowpan_fragments, list) { + del_timer(&frame->timer); + list_del(&frame->list); + dev_kfree_skb(frame->skb); + kfree(frame); + } + spin_unlock(&flist_lock); + mutex_lock(&lowpan_dev_info(dev)->dev_list_mtx); list_for_each_entry_safe(entry, tmp, &lowpan_devices, list) { if (entry->ldev == dev) {