Received: by 10.213.65.68 with SMTP id h4csp1716972imn; Mon, 19 Mar 2018 11:18:00 -0700 (PDT) X-Google-Smtp-Source: AG47ELuhsJjBkHyDgFBdnh9srzQmArIJWIBy0Eh3R5Eov8f9fOaRdsWw4Z+t4kDEzn9CqfJBte9p X-Received: by 2002:a17:902:8684:: with SMTP id g4-v6mr10316501plo.117.1521483480269; Mon, 19 Mar 2018 11:18:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521483480; cv=none; d=google.com; s=arc-20160816; b=08ukMhN0lFSri/HQRQe8IkZO2kbAIQGywVPymIvzgdYV7E796yp1FJRc4z7AlQqwrj pOPrPjZvz/TxnjwhauPvF2VenOIbYowRz79dwNViYpxqkJaHhDnvFriZdRSjI8D7Xj1a KLoIBhln+C6elGJlN9ZFqd0eE6/j18f/uXzMTtCCLQDO/QqlmFIkpGkBbORM4ykyGR3S vvlKOPd3S3L69zlLV+vkiPiKJQ8dIhIvIZupnHusPCH6tb0hNKcSrL5Sj26sa3Ef0s5M 1RJF2+FW4cFAR5zML/VTsBdJcV1+UOISJrHZ1Z884XoS5/gMaSUfxDKCjxqugSBoIxwP OFdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=MaIT6TIhiiUQkpPRLlRyg/enNu/wQUE2VeWIrF3geW0=; b=VDWJdxtD4i2+i3mGTqbW1iol4x4Zig57/8442VH+U/ntPy7Z6K+MgCUK1NG5S0bkeF bkw+hnuAWUAQWraCrOwgkQjamn7DjIduVRP8ANDF8IsY2tsefZ8APw4XBdL8VSpMji0Z 9mV7TeFFAjPEOJs+uAEOpj+dkFfmsI06dlEPdU9r4YslVBeYCBjKHTBaRKu+A8Oml/Yq l2I2/Mm6x2A43fo131l0JUxTMVLMy4Pm8NEkXHi5+3Db5KkYFIy/tcar2Dj0WuVZxLRo n0oGcD6bqNvgFAA4n0KM3yB0BVGlY87srNG/noxgYta8BsUKVa+w5Y4TjBoZMM0H3sKq CGIQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2si264239pgr.242.2018.03.19.11.17.46; Mon, 19 Mar 2018 11:18:00 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030619AbeCSSQn (ORCPT + 99 others); Mon, 19 Mar 2018 14:16:43 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45154 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030817AbeCSSQb (ORCPT ); Mon, 19 Mar 2018 14:16:31 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4D6FFFF1; Mon, 19 Mar 2018 18:16:30 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luca Coelho , Johannes Berg , Sasha Levin Subject: [PATCH 4.4 105/134] mac80211: remove BUG() when interface type is invalid Date: Mon, 19 Mar 2018 19:06:28 +0100 Message-Id: <20180319171904.347470584@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- net/mac80211/iface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -1441,7 +1441,7 @@ static void ieee80211_setup_sdata(struct break; case NL80211_IFTYPE_UNSPECIFIED: case NUM_NL80211_IFTYPES: - BUG(); + WARN_ON(1); break; }