From nobody Wed Jun 12 19:16:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VzwJK6TWZz5NHMY; Wed, 12 Jun 2024 19:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VzwJK5KMnz56MX; Wed, 12 Jun 2024 19:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718219793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aDQ/u6siWNHc9mTFmO1gKxC+4Rq7b1joBfRMnhKlSws=; b=bZtlQl53uNc4Qwv72EHpJYGaODY85k5NKGvjhaMhcV4H5BoAukHfxYWNdIOzc2RID2v+ol jGRp2YxeZBh+R1PMwz0i7JLnJ3r1D8LLUo1sPTwMA49qGb07QLX+/k4YvASpphMk9YxMtT 8A8GecPCLV9fQ+yib4jhZP6Fducz5jgL8YJcVRwOEpYF5LGHX+0eSlVdObyxrXcH+6BL8+ gYQnwuJIMQrLnPF/7CT4TcJqNnC6DiN8KvOfsjapEHkk1jwu1dOLUE7XRjSJm5ddw8VfFd qVgqflWzS4dBDaNMOOsuALc3lwlWN/ac8y5P6v8Rviweu74rR3IrSHGE9ZaVYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718219793; a=rsa-sha256; cv=none; b=geS28mokQWyidogEGkZRAxOv0zdCnXzda6uURbmSySgIY0gSubfukp96W528Z/NgPThtzo 0gyBwRrER8Rbu0lqMr2iar8UW1ZoihNm0J54Q+bXJsPyel5OZ8HZ/HdSixoJFNcThhtiQw y2UWe0fkeiW55WBJ+1tjZi3bQWLxF3tlqa8lJaMMeU/sAHAHxmR5GKZ8DTLo/LxNUJU5dx PRPUPm4q2o/kl1RalcfIkejEexWG6h31muWdClHbEu2B1Lub4LmmcGeREWYjeb/xMKUQ6k 3IjLkNFcAZ7Ecpd7s4BmbOTK8uGZ6nTyMDWBgJrpdT0BD2gHe38mJBwoE/lTxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718219793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aDQ/u6siWNHc9mTFmO1gKxC+4Rq7b1joBfRMnhKlSws=; b=v/E8Vrb30EX5cnCdMB1o9OgH+IH08pl2nt5R2MWG4Dm8dQKoaoEJ40cF7gAVhExqoT+xan Gbjx8U1i4C9nurMNNx0Tz4jdL9ZYA3dLHXzMtEiLcvwom2mBYYT3AMFeU31g57pbutKyyJ m8Acdg5qA7V0ZBPLxcMUF/XoHuorrWWdrg8WpdlAWy7jWmh9U361JqR+wiTcW4oNsvftVJ xn30UpPhgkFzOK6f6jOibc5Q6L1PxLBmR29LuLveGmAhBdaJmupyecGk25byGSn+WhQCPI gE7UrBmOCQnSe8PMKOV14PlC+LTxr8LL0PaYUuyU0Y1WotsRNeATJhn5KLRRvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VzwJK4x4cz14Tm; Wed, 12 Jun 2024 19:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45CJGX38003450; Wed, 12 Jun 2024 19:16:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45CJGX4T003447; Wed, 12 Jun 2024 19:16:33 GMT (envelope-from git) Date: Wed, 12 Jun 2024 19:16:33 GMT Message-Id: <202406121916.45CJGX4T003447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8e64a7ec0b5d - stable/13 - net80211: amrr_init: change order of commands List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8e64a7ec0b5d8a9b788ec36e9a17d896f7ebcd59 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8e64a7ec0b5d8a9b788ec36e9a17d896f7ebcd59 commit 8e64a7ec0b5d8a9b788ec36e9a17d896f7ebcd59 Author: Bjoern A. Zeeb AuthorDate: 2024-02-05 14:48:08 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-06-12 16:56:26 +0000 net80211: amrr_init: change order of commands First run the KASSERT before trying to do the free operation. Better for reporting and debugging. Add a guard setting the value to NULL afterwards. NULL pointers are a lot easier to test for. Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43751 (cherry picked from commit cd9fee3d2c370e81109505c2abfd381af952e9b3) --- sys/net80211/ieee80211_amrr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_amrr.c b/sys/net80211/ieee80211_amrr.c index 7248af0edccf..461554d75ea1 100644 --- a/sys/net80211/ieee80211_amrr.c +++ b/sys/net80211/ieee80211_amrr.c @@ -132,8 +132,9 @@ amrr_init(struct ieee80211vap *vap) static void amrr_deinit(struct ieee80211vap *vap) { - IEEE80211_FREE(vap->iv_rs, M_80211_RATECTL); KASSERT(nrefs > 0, ("imbalanced attach/detach")); + IEEE80211_FREE(vap->iv_rs, M_80211_RATECTL); + vap->iv_rs = NULL; /* guard */ nrefs--; /* XXX locking */ }