From patchwork Fri Jan 25 19:47:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Pedersen X-Patchwork-Id: 2047191 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 09DF1DF23E for ; Fri, 25 Jan 2013 19:49:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750996Ab3AYTs5 (ORCPT ); Fri, 25 Jan 2013 14:48:57 -0500 Received: from mail-pb0-f42.google.com ([209.85.160.42]:43340 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750776Ab3AYTs5 (ORCPT ); Fri, 25 Jan 2013 14:48:57 -0500 Received: by mail-pb0-f42.google.com with SMTP id rp2so400434pbb.1 for ; Fri, 25 Jan 2013 11:48:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=FWiebIHnsK0D43eZnPsMfYQAUWl15MohO19CcHI3BAU=; b=QsBj5NmaILh6DVyKGMx1a1TNLf+NEIZFEo2WEl2iv2f7HFQX6/QaYAUDOU9Df+Vcha uS8PGThegy37flcea4Z5WwasV4t9DTEK/vOcSpy13Bg9segDGfmA931NmhpeJ5960bHe FwLWrMS9jgVWMaY/DmQXgF/pWZVgSKbJOz9GQpRKmdQPCFpaq5czqwlqJzXaWcjgsgWh r0wpQrQweHjwUdngf1HC4ls1g0ZyxxIOE2dXKWsZ1frhaxKKBlAcvUMa9JSXhcTgQPUz zA7cuEgtPrE/EWfI1Tx+DAYkO/YWa7rV4uvTiLbq7yJzj08bcLRpVcTDeR2MsctgEfaP FCYg== X-Received: by 10.66.88.37 with SMTP id bd5mr15951135pab.75.1359143336523; Fri, 25 Jan 2013 11:48:56 -0800 (PST) Received: from cable.lan (70-35-43-50.static.wiline.com. [70.35.43.50]) by mx.google.com with ESMTPS id qt2sm1187706pbb.24.2013.01.25.11.48.53 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Jan 2013 11:48:54 -0800 (PST) From: Thomas Pedersen To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, simon.wunderlich@s2003.tu-chemnitz.de, Thomas Pedersen Subject: [PATCH] cfg80211: don't dereference NULL chan Date: Fri, 25 Jan 2013 11:47:55 -0800 Message-Id: <1359143275-28359-1-git-send-email-thomas@cozybit.com> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQnRawwhCduMgjilzhHaH7tRnENFwO8R7otdpiqCo7fyuOX8vK+tihTT7YYBLMnmucauRGUf Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The patch "cfg80211: check radar interface combinations" would dereference chan even though this may be NULL. Fix a page fault when adding a new interface by adding a short-circuit check for NULL. Signed-off-by: Thomas Pedersen --- No action required for this to make it into 3.8, right? net/wireless/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/wireless/util.c b/net/wireless/util.c index 1c2795d..d1decbc 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -1212,7 +1212,8 @@ int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev, case NL80211_IFTYPE_MESH_POINT: case NL80211_IFTYPE_P2P_GO: case NL80211_IFTYPE_WDS: - radar_required = !!(chan->flags & IEEE80211_CHAN_RADAR); + radar_required = !!(chan && + chan->flags & IEEE80211_CHAN_RADAR); break; case NL80211_IFTYPE_P2P_CLIENT: case NL80211_IFTYPE_STATION: