{
        struct dentry *dbgfs_dir = vif->debugfs_dir;
        struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
-       char buf[100];
+       char buf[3 * 3 + 11 + (NL80211_WIPHY_NAME_MAXLEN + 1) +
+                (7 + IFNAMSIZ + 1) + 6 + 1];
+       char name[7 + IFNAMSIZ + 1];
 
        /* this will happen in monitor mode */
        if (!dbgfs_dir)
         * find
         * netdev:wlan0 -> ../../../ieee80211/phy0/netdev:wlan0/iwlmvm/
         */
-       snprintf(buf, 100, "../../../%pd3/iwlmvm", dbgfs_dir);
+       snprintf(name, sizeof(name), "%pd", dbgfs_dir);
+       snprintf(buf, sizeof(buf), "../../../%pd3/iwlmvm", dbgfs_dir);
 
-       mvmvif->dbgfs_slink = debugfs_create_symlink(dbgfs_dir->d_name.name,
-                                                    mvm->debugfs_dir, buf);
+       mvmvif->dbgfs_slink =
+               debugfs_create_symlink(name, mvm->debugfs_dir, buf);
 }
 
 void iwl_mvm_vif_dbgfs_rm_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)