On Thu, 23 Apr 2020 at 14:29, Johannes Berg johannes@sipsolutions.net wrote:
On Thu, 2020-04-23 at 14:27 +0530, Sumit Garg wrote:
+++ b/net/wireless/core.c @@ -473,6 +473,10 @@ struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv, } }
/* add to debugfs */
rdev->wiphy.debugfsdir = debugfs_create_dir(wiphy_name(&rdev->wiphy),
ieee80211_debugfs_dir);
This cannot work, we haven't committed to the name of the wiphy yet at this point.
Maybe I am missing something, can you please elaborate here?
Looking at the code, the default or requested wiphy name is configured just above this and the rename API "cfg80211_dev_rename()" takes care of renaming wiphy debugfs directory too.
Yes, but I think wiphy_register() can still fail at this point, due to name clashes or so?
In any case, it'd be very strange to have a debugfs entry around when the wiphy doesn't exist yet, and could possibly cause the same issue that you fixed again, just through debugfs accesses?
Now I understood your point. Yeah it's definitely better to expose debugfs after the wiphy device is registered.
Can you take a look at the patch I sent?
Sure I will take a look.
-Sumit
johannes