Received: by 10.223.185.116 with SMTP id b49csp1095912wrg; Sat, 3 Mar 2018 15:25:35 -0800 (PST) X-Google-Smtp-Source: AG47ELtSxX0EgKcO7eXDF92yNC8YcZu2lrJmvA2tIFedfGksN0B+egXjNTcW7Tbcl4uSDa2gaJhx X-Received: by 2002:a17:902:8608:: with SMTP id f8-v6mr9110658plo.366.1520119535005; Sat, 03 Mar 2018 15:25:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520119534; cv=none; d=google.com; s=arc-20160816; b=x2MoAdRphvP6jQQIzJWn/dca/CS0M+ySzxx78Qu34a1hj6Xx/4mrceAnygO2YSfo7+ nF9lE0saaOovPJx91g9d772OCEE97gwYtgnbEKgGFU+CXLnka+gyvccJlQQYk2D2ZGZP Q9p3jhguSnTfoBFJ201X3WOJ8dDPP1S6ZL3W/qRaknZ3nHioSSP0QxNxNYTJwmEvn70X wK9WWfmyD/Q/oNHvj5R3fap7oCyZAootx33+Sfb6YXabXnDroG3dmnPT1ZG7KbwrBKLZ c+GTD4f4gQA5uwpSp904HtRHRtYD/5aoZBvATgA9h/REA7Bppk8zSlJNp7qbEBhuGGL8 FdkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=67Z5vwI37sWmW65HHEJ7CaHlIOcex4sEdfJHwjEzkH4=; b=SVU7uv/wVUw4ogi/d8hDP6oOxKJ3CyWwe0jKt6Lp0GEjRvU9+2qLvp5XUiGfKCNIW9 Lo1eX4AzOIGGczVHAwJQCOwcrNiivrdu32GUoqCPnRuCPtji5JPnPX8OTXQKppxQU7nP djecli0Jy+TypaZeIrwnx3axOpPXeoeI4N5KdRH6cpJ8mDX+PgOrTteQsFx5XXdHwMmk LrKg6akTB2s0EsYYoFqVbE5pUX6SmSq+4kwYPnA9qggppLlIT0w1TfnHPnFbBsf2If1F GwuyNp+O2FrWP9AccSGTNMt6IV1WmZChNQ4ei7dEgb4atIp9e4Jdcj9/ImG3WWa6gpMe SPQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=cCyofvK9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j191si6081355pge.369.2018.03.03.15.25.20; Sat, 03 Mar 2018 15:25:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=cCyofvK9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934305AbeCCXXW (ORCPT + 99 others); Sat, 3 Mar 2018 18:23:22 -0500 Received: from mail-co1nam03on0134.outbound.protection.outlook.com ([104.47.40.134]:45128 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934689AbeCCWhv (ORCPT ); Sat, 3 Mar 2018 17:37:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=67Z5vwI37sWmW65HHEJ7CaHlIOcex4sEdfJHwjEzkH4=; b=cCyofvK97/OMJ2ZgeA61ki38u8CZpz9rxdmMz3LNiUJXO3Z/JnAfL2xm6qixtt8QO3CXUpNgocNcjMujFaqGMD7Hp5EadMAopg1af7W6mwm5sjd84dvnUmoURya6y6AkwsfL78GL64PznEQlyRbcPqiDQvNAWju+YBK3SetRwbM= Received: from MW2PR2101MB1034.namprd21.prod.outlook.com (52.132.149.10) by MW2PR2101MB1100.namprd21.prod.outlook.com (52.132.149.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.2; Sat, 3 Mar 2018 22:37:48 +0000 Received: from MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0]) by MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0%3]) with mapi id 15.20.0567.006; Sat, 3 Mar 2018 22:37:48 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Luca Coelho , Johannes Berg , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 214/219] mac80211: remove BUG() when interface type is invalid Thread-Topic: [PATCH AUTOSEL for 4.9 214/219] mac80211: remove BUG() when interface type is invalid Thread-Index: AQHTsz8rpH2H4fAYK06lB0vYTE5Jog== Date: Sat, 3 Mar 2018 22:30:01 +0000 Message-ID: <20180303222716.26640-214-alexander.levin@microsoft.com> References: <20180303222716.26640-1-alexander.levin@microsoft.com> In-Reply-To: <20180303222716.26640-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MW2PR2101MB1100;6:+WU+TWBGsvcTUerbeJkKQn7fWugn+tUQMxxK2MBoj8/RVrgSKvZMBGoV9f4Kf7DT4IeeP6sQLTAqxY4UOEYJnz6p8pjOZ8hZItA6UyAwDx4ZzeJvlANrSgVwkDns6ASgGEK3ABUGM72XCpn6V/wZTdTxAt0Wrb8kYQwJas6bn6J1XbhCWutRWC7TZIVPAOUb++zCW+zmo+N4hflGEr7EUiMAkLfaV6i83JNsUyZKypGhS57pFSbmxxHCuI41woT9+Lx52fNt1w5xw3pyWLP12ufVnhYtWrYYbX8KVktRczWTfrGDoM1RpdzuwmTUXHf7V33HnHgrD9sHF9mRgUoF1zhecokcHTW+jNUIalhpzvyW7qEO1kDgWvmFjcDLrgFI;5:ocSflg2+3GFip7GOfcZWtPt5akYbfbBE8NQG8aqCat7Z2rrtMpbdtjAIMs+wk0cEaT6JWaalDuS4ikrAX498NU5Ir0pbPE+85SR9VgHyLh4um8gj95ti9unlKX/GWmf+qQtjLM9MVw4P45bc9ZP5gadqrxZQIEokueof2F4P6ok=;24:2wMJXaspP/9IsBGF0eFSz9idB6xDDQ8Xq/BWf2XXZbK8va95d05bku2U8zee68gxRMon0idN3+63CqffIN5CjxFt5w6nynzfd9xkawzXYWw=;7:pdVurfVJ+/Nm7x1tv5tyrqtjhnJ0r0VOAgbjYADWT9M1SsFpaBQD6mfkVJgZ6Y1k8Btktcy2pJU+KjzlU8BP8pnbPo4E/rxE9HPdRWNp+bV9QAGi9+omrqAxajn9EreN5rcoNfVTGYQgX09tWGPKBhw/dfy9NtwFoM2GyeJylBJMltEUgA8mHuMuFX0IoQOw+Sqz1IksACkGVIyjeRkkiqGnouIGFaL60azpKhAzDA4G0v2iqWwEGDVULP73o2C+ x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 0c3575da-6676-4283-1fc4-08d581576448 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:MW2PR2101MB1100; x-ms-traffictypediagnostic: MW2PR2101MB1100: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231220)(944501244)(52105095)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:MW2PR2101MB1100;BCL:0;PCL:0;RULEID:;SRVR:MW2PR2101MB1100; x-forefront-prvs: 0600F93FE1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(39380400002)(376002)(39860400002)(396003)(366004)(346002)(199004)(189003)(22452003)(97736004)(7736002)(5250100002)(105586002)(2906002)(6506007)(72206003)(66066001)(59450400001)(4326008)(305945005)(10290500003)(186003)(3280700002)(102836004)(2950100002)(6666003)(2501003)(478600001)(26005)(2900100001)(10090500001)(53936002)(8676002)(25786009)(81166006)(81156014)(54906003)(86362001)(6436002)(106356001)(110136005)(68736007)(36756003)(316002)(6512007)(5660300001)(107886003)(8936002)(1076002)(6486002)(3660700001)(99286004)(76176011)(3846002)(86612001)(14454004)(6116002)(22906009)(217873001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:MW2PR2101MB1100;H:MW2PR2101MB1034.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: LPlG+9V6ouTBItmUSXGhTz92FnIpm1rWipMhoHRi9RqZZ9J9AyjgmkqX6bwEun+XbfucM2Wbx/Cswi1om0ZmsBeyINfMZc6nsP9pGgP4cJhOPQEnmrha6pzj4orES/hNcwjI7MnSw11Bw1wqoaiSFgbecEeh5HZJZiu62PbXoX4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c3575da-6676-4283-1fc4-08d581576448 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2018 22:30:01.0258 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB1100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luca Coelho [ Upstream commit c7976f5272486e4ff406014c4b43e2fa3b70b052 ] In the ieee80211_setup_sdata() we check if the interface type is valid and, if not, call BUG(). This should never happen, but if there is something wrong with the code, it will not be caught until the bug happens when an interface is being set up. Calling BUG() is too extreme for this and a WARN_ON() would be better used instead. Change that. Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/iface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index a7aa54f45e19..fa7d757fef95 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -1520,7 +1520,7 @@ static void ieee80211_setup_sdata(struct ieee80211_su= b_if_data *sdata, break; case NL80211_IFTYPE_UNSPECIFIED: case NUM_NL80211_IFTYPES: - BUG(); + WARN_ON(1); break; } =20 --=20 2.14.1