Received: by 10.213.65.68 with SMTP id h4csp468714imn; Fri, 16 Mar 2018 08:40:52 -0700 (PDT) X-Google-Smtp-Source: AG47ELubF1CGg6nHQ3WPOL/ilfr/VxK5GaSZ9bkVu3miB4g5qwparbIGWVm7qmxst4HzoGxPqX02 X-Received: by 10.99.181.78 with SMTP id u14mr1791715pgo.205.1521214852148; Fri, 16 Mar 2018 08:40:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521214852; cv=none; d=google.com; s=arc-20160816; b=UQ8U0TGgkeJralP7n6cCeoTdRYb6BBw+vcnYm9hjkO4WSi3Cm8RylJJp/QP2KKaCwK vMrxJ6zfgHkpoLc16YIl9GsqQB5s2b47XnsQ6Vi+9L1wrISyfBCfuf+afdmTSt6p0tto gug32lgFg68mQ9tWvKRVmyj6K9sbpHrM/DaslByTBGDvYcJA9Wl8n43SWT28T4BhvLZx nH2sMhUyOwpw4bDesGK78LtfZmrbwr4DU9OsakBiCWkNQjT04rjGSuWThAQhtWJExRW8 fUeE+U2k8oUnP5B1egWa8xtB38zGb3mMWBSVk6irsH1HrzjR/f9raN44QKictp3HRbvA vnOg== 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=7t1u8rWtuVjoO9T4APyoUnsG3uLDUsFjuiGHxld0TP4=; b=HH+tGPK4T5+ITBm4Phr615TrjvPlr969CiQOg7CaHo/Bt64gG1B6aaiskpvxrMFAln DLD6N7mgVG7LGNqbWp99FwIHA62VaI4/Mm3mb1rVsI23oJBj6L75tkmecQR96Pm876pB KqzlZtIDuhtUq4rGZVkS/zonS4fal30QiYDJbtir3kkMGy2Uzm9sRDUdlDroXc7NnW6z FHmjWddFdQ0HXMOyDp7IkHI4piWl64YB5LxETvqaj0oBOQA+8/q4NPpARp6fmFgSJzTU kA1AQFzezAeVqMhx3jTwROr5K/I5LE3rl/cf6O+p8uLi6/mX5rzY8ICakKmleiG42nAU i3cQ== 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 bb5-v6si6172655plb.407.2018.03.16.08.40.38; Fri, 16 Mar 2018 08:40:52 -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 S1754547AbeCPPi1 (ORCPT + 99 others); Fri, 16 Mar 2018 11:38:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42570 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754501AbeCPPiX (ORCPT ); Fri, 16 Mar 2018 11:38:23 -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 2CF9CC76; Fri, 16 Mar 2018 15:38:23 +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.14 098/109] mac80211: remove BUG() when interface type is invalid Date: Fri, 16 Mar 2018 16:24:07 +0100 Message-Id: <20180316152335.197757024@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152329.844663293@linuxfoundation.org> References: <20180316152329.844663293@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.14-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 @@ -1493,7 +1493,7 @@ static void ieee80211_setup_sdata(struct break; case NL80211_IFTYPE_UNSPECIFIED: case NUM_NL80211_IFTYPES: - BUG(); + WARN_ON(1); break; }