Received: by 10.213.65.68 with SMTP id h4csp472481imn; Fri, 16 Mar 2018 08:48:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELv/9GUK1TaOY868IJEyHUu1h3xUPPoez2I3Ar/mLat0C5m2LkKbqenZUmLYah+Gt8L+zuFh X-Received: by 2002:a17:902:c1:: with SMTP id a59-v6mr2633359pla.284.1521215312731; Fri, 16 Mar 2018 08:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521215312; cv=none; d=google.com; s=arc-20160816; b=wtA9ZsDhlQ00pb8uRKQXdvd+DTcFC+fSWbEI3hg0KvzyaELMslyWXHMI4Z4pTqVx7x YJtgVZwXfX3kbAHM3JbzlODs0AvEmoPCDxCgD3fSwmFh5AtP7+vqbDuEwjuVi9wEpRr5 GclwZUTimbmcp5/bgpI/RD8fvvZEGv7JhFSyUYpnLzqBca/KraPPFZgGSvt54z6Do7qF bZz1exg4bTRaUZGMnhe7Fd3pzHQOQVRnLiyJo0V+EAgdmIzfGwFl6+2l0TEV1ARwibnU kaHUNJGmbOJV87X8MnhxzjiaHakuCEIdzss0MQ91rMpt2mDr+mIbsNpmcUCdwNaK78kV e6IQ== 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=tAuOSwzdnQ3Fk6x4+O8iq29VcAkUduK80Bdn+YnvSgM=; b=CfgnZwnvOup0drWirDYwoNofALOVTtYyivl8R19C+gzCyQpeZy5z3OV01u4OQ/NMvj lIiPTFpteRTvISblYftpodLoK4yd29ky2+SokoPOZqAD+sncdmD4r//gxJC8Ppqr2WQs zhqOIg4DibxiJo0eLMpNX3UpPcCJmugGX1HyYADYWqBwn7YtQFcqkylbeaZNw6UnihRr u1OxXnbMraMGGOobfRP1rzoPzDUCKnjZPGXzjSaP814cDvLRiFc33eeNbH520Ze9UA2N 2fV0L8HBYXqgeKKLKJIyihoLyQLfeDarJ1vF1gw08XK2WsTgc2SWviMPh2sScHrZdCGp gjag== 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 l7-v6si6931136plk.380.2018.03.16.08.48.18; Fri, 16 Mar 2018 08:48:32 -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 S934592AbeCPPqz (ORCPT + 99 others); Fri, 16 Mar 2018 11:46:55 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46204 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965514AbeCPPpF (ORCPT ); Fri, 16 Mar 2018 11:45:05 -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 65C68F1A; Fri, 16 Mar 2018 15:45:04 +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.15 117/128] mac80211: remove BUG() when interface type is invalid Date: Fri, 16 Mar 2018 16:24:18 +0100 Message-Id: <20180316152342.303786912@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@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.15-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 @@ -1474,7 +1474,7 @@ static void ieee80211_setup_sdata(struct break; case NL80211_IFTYPE_UNSPECIFIED: case NUM_NL80211_IFTYPES: - BUG(); + WARN_ON(1); break; }