From patchwork Wed Feb 26 01:09:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Luis R. Rodriguez" X-Patchwork-Id: 3719961 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8262ABF13A for ; Wed, 26 Feb 2014 01:10:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 941BE2020A for ; Wed, 26 Feb 2014 01:10:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41BFA20204 for ; Wed, 26 Feb 2014 01:10:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752169AbaBZBJ4 (ORCPT ); Tue, 25 Feb 2014 20:09:56 -0500 Received: from mail-pb0-f50.google.com ([209.85.160.50]:53237 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752128AbaBZBJz (ORCPT ); Tue, 25 Feb 2014 20:09:55 -0500 Received: by mail-pb0-f50.google.com with SMTP id md12so216575pbc.37 for ; Tue, 25 Feb 2014 17:09:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=07bjvdwx78LLf9r2uf3ozHCbvrpTvYJSotGmGRj2Fn0=; b=Icrp/hUeDzhl//Wqz1QYD5MZm/kdf+s26oigM8HzKHZ8ANv9alfzivTkn2GBYHz8C8 C3FnoMb+PauWc8igA4jF+P/dx69MGUTC/lwGydJe8T8z+JnZz0X0nwWPw4SLeQW5eLP2 yRe/lGY0z6Hs2/Byqj2RBFNVF0V+sT3abWSGSQmF6a7bLxH1XRxHhzyRwycvevbSQHwe TRzWvzxzVn5Oc4DOpX5HLzTl7GAb5VrEGjDnl5lMyWPTsW/7SNYdWO1glJCom5NDncjw zMpJhOO5wEQPDNvZuOWNw/N2uCLPlCcyG35asfuAis3jhmOIlI+fMlRBAB0Z5GgIZsEP DdMg== X-Received: by 10.69.21.106 with SMTP id hj10mr3051107pbd.87.1393376994777; Tue, 25 Feb 2014 17:09:54 -0800 (PST) Received: from mcgrof@gmail.com (c-24-7-61-223.hsd1.ca.comcast.net. [24.7.61.223]) by mx.google.com with ESMTPSA id yo9sm154494832pab.16.2014.02.25.17.09.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 25 Feb 2014 17:09:52 -0800 (PST) Received: by mcgrof@gmail.com (sSMTP sendmail emulation); Tue, 25 Feb 2014 17:09:49 -0800 From: "Luis R. Rodriguez" To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, linux@eikelenboom.it, "Luis R. Rodriguez" Subject: [PATCH 1/3] cfg80211: allow reprocessing of pending requests Date: Tue, 25 Feb 2014 17:09:40 -0800 Message-Id: <1393376982-28276-2-git-send-email-mcgrof@do-not-panic.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1393376982-28276-1-git-send-email-mcgrof@do-not-panic.com> References: <1393376982-28276-1-git-send-email-mcgrof@do-not-panic.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In certain situations we want to trigger reprocessing of the last regulatory hint. One situation in which this makes sense is the case where the cfg80211 was built-in to the kernel, CFG80211_INTERNAL_REGDB was not enabled and the CRDA binary is on a partition not availble during early boot. In such a case we want to be able to re-process the same request at some other point. When we are asked to re-process the same request we need to be careful to not kfree it, addresses that. Reported-by: Sander Eikelenboom Signed-off-by: Luis R. Rodriguez --- net/wireless/reg.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/net/wireless/reg.c b/net/wireless/reg.c index b95e9cf..f5b120f 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -240,19 +240,21 @@ static char user_alpha2[2]; module_param(ieee80211_regdom, charp, 0444); MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code"); -static void reg_kfree_last_request(void) +static void reg_kfree_last_request(struct regulatory_request *lr) { - struct regulatory_request *lr; - - lr = get_last_request(); - if (lr != &core_request_world && lr) kfree_rcu(lr, rcu_head); } static void reg_update_last_request(struct regulatory_request *request) { - reg_kfree_last_request(); + struct regulatory_request *lr; + + lr = get_last_request(); + if (lr == request) + return; + + reg_kfree_last_request(lr); rcu_assign_pointer(last_request, request); }