From owner-freebsd-wireless@FreeBSD.ORG Wed Aug 1 17:05:06 2012 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9595A1065673 for ; Wed, 1 Aug 2012 17:05:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-gg0-f182.google.com (mail-gg0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4CA868FC17 for ; Wed, 1 Aug 2012 17:05:05 +0000 (UTC) Received: by ggnk4 with SMTP id k4so803831ggn.13 for ; Wed, 01 Aug 2012 10:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=UB0KdRLrMQXzAI1yNQjfCDeBOAiaoWh7Max7m8+H+gg=; b=yAgq0lOxag48BUko5CLMDMnfYjJulz9P+HfZdg7fuK6Znzh93FkkGgkSpZGe86s69m nn1BKgE0JynZepZLPKmqD98bxRig7XV6TqTUmvkxtuVq56HqA7J3j0PjxM7161Td7UY3 I2TDioS9MPXvMmtDSsM7zZ8ODy+Y0Qm/Ucw6TG/bqb/7A+s4Hlt9iQF3Nw4tST5qu0lt YvxxZmP/XJ4C7TvjQhWD4Sw1QU+O2HB9vJLw99v1q8gNDIYRPESls9u0YUuVfLaTO3ji 1TN2QbRCzCm0S/Lkp8wMgrEjnyvt9lxIrUDXZrQcgLVyPdaLHLFBBmAHaM+a2aB+y5EG x0hw== MIME-Version: 1.0 Received: by 10.66.75.201 with SMTP id e9mr41232193paw.54.1343840704939; Wed, 01 Aug 2012 10:05:04 -0700 (PDT) Received: by 10.68.66.136 with HTTP; Wed, 1 Aug 2012 10:05:04 -0700 (PDT) In-Reply-To: References: Date: Wed, 1 Aug 2012 10:05:04 -0700 Message-ID: From: Adrian Chadd To: PseudoCylon Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org, Kim Culhan Subject: Re: ath lor X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Aug 2012 17:05:06 -0000 Hm, not quite there. You're still grabbing the node lock before you call the callback. That's the wrong spot. You need to put the NODE_LOCK/NODE_UNLOCK calls back where you assemble the list of nodes, not when you call the callback. All the callback loop needs is: (for i = 0; ...) { if (ni == NULL) break; (*f)(arg, node array entry); ieee80211_free_node(node array entry); } Ther'es no need for the node table lock there. You only use the node table lock when you're iterating through the node table. That's being done in the first pass. You're also calling ieee80211_free_node() on ni, but you're not assigning ni anywhere. Adrian