Received: by 10.213.65.68 with SMTP id h4csp37475imn; Mon, 19 Mar 2018 18:45:55 -0700 (PDT) X-Google-Smtp-Source: AG47ELsLtJDtwDMEFKn/i8jtl6+BzPglNeYjljA00avyn0TfTumfD2Wnn+KABYd6G8bhmJZi0r5u X-Received: by 2002:a17:902:8206:: with SMTP id x6-v6mr7664630pln.256.1521510355109; Mon, 19 Mar 2018 18:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521510355; cv=none; d=google.com; s=arc-20160816; b=GLf0tVje7Xc7IJXaScBYDEBXIrBi0fsAbSt2cD9WwoP34H6XPeNYnOY2LGq6DxXlcW 3TizEsAaEoDZinQcxvgBugqcSrnQl2pESS1f2tSMh4ulwlpjEzaF3hHL8EJv0iVc/UZk VNSdnpRcSQdqQ5XThsCHrxTNKDBP2AP4LwJRYHndQCvOKsYaOcDWHFHNOK3NavTaV2sF YgRAah8PeF+9yi07ixEGLv1+XGXj0gLXRQDEFUvwLAqcvC5TON6yFXsHLjTf/3bBNyFG 0ANxH/nwOUrGRM4GiCdDYn7OJl5HCrz2/Z9uUJCCroO13Slb/2NADmGdFbKbNpJ7HJk2 9s+A== 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=jyc1PWWrDWsr4pr6pfusJD97futtXEfpfXpAD6NOKSY=; b=AN0dsQdhVLZb0709MeHmBsWWUVlP08URh/tAwpUDiDucOCFffR1pZZdlbu3o4NBpyB 4eRWnjijDaHegTxukEeF0SZl1c3fMm1cMuRIHIJ+8It7TkVfkn4jTBMxD6yz1RX4ZaUS ZMY/wTjm9v/jphHyuMM2WoEFz8DDkCl8HL5tqPBw534yjbl23BzBdOGkX3WAiDsrtnIh 1+RrHkgqjGmGdA/0MxlOz7U1Gidua79v8A9Cs8m0NXfudGVH//C4f2tSN/EgshUXWVd9 6UsNzcjDAbHhxcxdXaIfN11SoMkR2mdd10K1OT/oiGM8gGOnE5q+dQe+PSRWzCyONJnj 6M1g== 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 n70si453712pfk.55.2018.03.19.18.45.41; Mon, 19 Mar 2018 18:45:55 -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 S970766AbeCSTMt (ORCPT + 99 others); Mon, 19 Mar 2018 15:12:49 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51090 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031671AbeCSS1G (ORCPT ); Mon, 19 Mar 2018 14:27:06 -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 89F7611D5; Mon, 19 Mar 2018 18:27:05 +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.9 204/241] mac80211: remove BUG() when interface type is invalid Date: Mon, 19 Mar 2018 19:07:49 +0100 Message-Id: <20180319180759.627285068@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@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.9-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 @@ -1520,7 +1520,7 @@ static void ieee80211_setup_sdata(struct break; case NL80211_IFTYPE_UNSPECIFIED: case NUM_NL80211_IFTYPES: - BUG(); + WARN_ON(1); break; }