]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: iwlwifi: mld: fix BAID validity check
authorJohannes Berg <johannes.berg@intel.com>
Sun, 20 Apr 2025 06:59:59 +0000 (09:59 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 23 Apr 2025 12:45:29 +0000 (14:45 +0200)
Perhaps IWL_FW_CHECK() is a bit misnamed, but it just returns
the value of the inner condition. Therefore, the current code
skips the actual function when it has the BAID data and makes
it crash later when it doesn't. Fix the logic.

Fixes: d1e879ec600f ("wifi: iwlwifi: add iwlmld sub-driver")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250420095642.9c0b84c44c3b.Ied236258854b149960eb357ec61bf3a572503fbc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/agg.c

index db9e0f04f4b77d5f8b13e54b47c8c9c94a2ff0e3..687a9450ac98409745478cfbd91463914858bb24 100644 (file)
@@ -124,9 +124,9 @@ void iwl_mld_handle_bar_frame_release_notif(struct iwl_mld *mld,
 
        rcu_read_lock();
        baid_data = rcu_dereference(mld->fw_id_to_ba[baid]);
-       if (!IWL_FW_CHECK(mld, !baid_data,
-                         "Got valid BAID %d but not allocated, invalid BAR release!\n",
-                         baid))
+       if (IWL_FW_CHECK(mld, !baid_data,
+                        "Got valid BAID %d but not allocated, invalid BAR release!\n",
+                        baid))
                goto out_unlock;
 
        if (IWL_FW_CHECK(mld, tid != baid_data->tid ||