Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp578154rdb; Mon, 29 Jan 2024 11:01:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6LVhzERexL4FqR78Qn5CBCBk88CP5eif7gXIRueUzAxCD2uqB+v++fgyunRdxFZOndwji X-Received: by 2002:a17:906:718a:b0:a31:6b0a:1729 with SMTP id h10-20020a170906718a00b00a316b0a1729mr4711225ejk.10.1706554912156; Mon, 29 Jan 2024 11:01:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706554912; cv=pass; d=google.com; s=arc-20160816; b=JQDAZ71JYeVHT5wBGysw2U/Ik3/ViEGPqZoEPEvauMWh89fUcidm3N2kPcjbf6/adW XMJm5ocoxbYadtSHo1tYjx2td2LO/3F/93YpFI3nG8s8SBYh2lVh6gutQZtRVEpA4Nc6 z32PKERq57/9KoiaE73LXyRRWQolDE2tWpBLmbLnmv7AEOMhE8WOkVMdLkamLCN1F+na SBQRzfY8kD0/DmXnln9AzVWO6jLSSNnX8v0EOsIVIfAjhehb3A5Cg5cdF2UBs3zDb4eT iIofl10VnXYlRVGayhLP1XFU0gjQay+y1CJ5PTMX0YdM9X1kGSaH4dRvRCSuqnpAZO9t SVIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=TRS0TwZfnpIzABYziayrMWmZOvf0lrRT2IIV8nc+K+U=; fh=0lKBV5x7F70XB9FRQsRlbOV1OPiUzND3I3EQToQR7aQ=; b=xgAI2rGHWB6G3SUxXHXkzYMPmLmgyXnR6A9KQhEnFI+i1AJE+F38htXY/xjH8lWQna BQ3cgy8PZ8zU/KQPqhEF3epi7ZJfQXF8kUmYQ5OW6KFU+CJZJJu6gg+INaNnqtXjBt/d Pc1BXiqLoW25Ej0Kjoch69enqKcC9HdXLjXNXuq8cP278A1RUfKtV0HqAQtVKcrfT4MK OPJJEktc/qxLOh2FZJbWwJrYZQ4fJDp182IJul2X647rREXWXGDvItu3OisKvtdE7INZ 6po3qexiXdDIef746BM0F5aUBY/LGxeTx7abICLyc8p65gHj4tDCuKCzVjPMIwDvVjZj dm3g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=DURfftgS; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2703-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2703-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net X-Forwarded-Encrypted: i=1; AJvYcCUcn4HajC5xVQ7XyPZlWyOyqRDll/kzDvEO9zLfZ7Wi3CpIHvbCrltkiwFzvMqSt7OfuLa3Q9hxsBEpXq6Nj55Dp8PgTagbOMdLaZnowA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id jo4-20020a170906f6c400b00a35031b4938si3510459ejb.1049.2024.01.29.11.01.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 11:01:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2703-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=DURfftgS; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2703-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2703-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BED691F22117 for ; Mon, 29 Jan 2024 19:01:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05829241EC; Mon, 29 Jan 2024 19:01:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="DURfftgS" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93B6F2E85E for ; Mon, 29 Jan 2024 19:01:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706554866; cv=none; b=SU9zF1InKb+qruZzGAQOeX3rcwEKTLQ4FxoFdoqGIGCNA0F1kHT+Jh9w8z4ZCYcghAKXEbCiLZpy3F1ACusk/nq0K318bNTYB5PgGO9apoivGwnlMBa63nwnFdKn2zT5JXFmSrTS4D6y05VMTekcy5mFoc3dWiJu4cHF/22PiAc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706554866; c=relaxed/simple; bh=CvN1ySvJLuu4RN0j4uTOxpixHqUEdlGl1jjaOMa3GPw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UQwi05JmyKu6oBZGrYlW4ZeVaHVNbY28QgTXrNVJCinvTj+Y8q+dFwsNjrEnVQGkBJldPtUTKEh0k7japbSyAjpBjcGio/BqKCU6RzRe6t/+eLjjVffeMK723lYMDJ/vj2Sy+L0it8gokMwlm1n0TBWMRPZ/O2HLFUb6VwOZT1c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=DURfftgS; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=TRS0TwZfnpIzABYziayrMWmZOvf0lrRT2IIV8nc+K+U=; t=1706554861; x=1707764461; b=DURfftgSEqWGk1lB9BA88RSRRPrypnwjpUfawbGfClYdAqK Nee9XzpjilW0w9vw7VErhOQwZu8VdryH2OPAZoHiljriklwwok1oMYDkp7Q6L0sHvJvyhWvZ2mwXr /Uv9DgVeiVLk1/j7NyhP5NwpTx0+GOL+XgEZ9j4HGCtk4pLW5S3lK54OtWkA0oFA9yINpRR86sRsA pgjXD41cRyEWDjKAiCckm7l5KfJjKaQ52MKppMV482fOI58yCPKocEdrLu/3UNjAS8bmvCIROvEW8 iKbnwiCrh7UV1U8QJyzy+51u8wO36IQeIYiHTfLXKrwzV6CQ5izEpP5gzwzlsszw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rUWsM-00000004zxs-3wLJ; Mon, 29 Jan 2024 20:00:59 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Miri Korenblit Subject: [PATCH 2/2] wifi: mac80211: don't allow deactivation of all links Date: Mon, 29 Jan 2024 20:00:53 +0100 Message-ID: <20240129200054.e3c113f94508.Ia35f927f914bf98dd8f9350dd4f78b1d901b1c1d@changeid> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240129200054.f5459f6c29c8.I397814449e17950fcf882ef44a1e790a71aa1dce@changeid> References: <20240129200054.f5459f6c29c8.I397814449e17950fcf882ef44a1e790a71aa1dce@changeid> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Miri Korenblit The set_active_links API is intended for link switching, so switching to no links at all is not supported. Add a warning to check that. Signed-off-by: Miri Korenblit --- net/mac80211/link.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/mac80211/link.c b/net/mac80211/link.c index 79bda7184fe8..4f19d6479bef 100644 --- a/net/mac80211/link.c +++ b/net/mac80211/link.c @@ -445,6 +445,9 @@ int ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links) lockdep_assert_wiphy(local->hw.wiphy); + if (WARN_ON(!active_links)) + return -EINVAL; + if (!drv_can_activate_links(local, sdata, active_links)) return -EINVAL; @@ -473,6 +476,9 @@ void ieee80211_set_active_links_async(struct ieee80211_vif *vif, { struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); + if (WARN_ON(!active_links)) + return; + if (!ieee80211_sdata_running(sdata)) return; -- 2.43.0