]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: iwlwifi: Fix dentry reference leak in iwl_mld_add_link_debugfs
authorMiaoqian Lin <linmq006@gmail.com>
Tue, 2 Sep 2025 04:09:49 +0000 (12:09 +0800)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sun, 7 Sep 2025 06:41:35 +0000 (09:41 +0300)
The debugfs_lookup() function increases the dentry reference count.
Add missing dput() call to release the reference when the "iwlmld"
directory already exists.

Fixes: d1e879ec600f ("wifi: iwlwifi: add iwlmld sub-driver")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://patch.msgid.link/20250902040955.2362472-1-linmq006@gmail.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/debugfs.c

index cc052b0aa53ff33f0a70c48ce19c28c6deb217b1..372204bf845224c0d28f744b051f497ee9387ed8 100644 (file)
@@ -1001,8 +1001,12 @@ void iwl_mld_add_link_debugfs(struct ieee80211_hw *hw,
         * If not, this is a per-link dir of a MLO vif, add in it the iwlmld
         * dir.
         */
-       if (!mld_link_dir)
+       if (!mld_link_dir) {
                mld_link_dir = debugfs_create_dir("iwlmld", dir);
+       } else {
+               /* Release the reference from debugfs_lookup */
+               dput(mld_link_dir);
+       }
 }
 
 static ssize_t _iwl_dbgfs_fixed_rate_write(struct iwl_mld *mld, char *buf,