diff mbox series

[net,001/117] mac80211: set .owner to THIS_MODULE in debugfs_netdev.c

Message ID 20201008155209.18025-1-ap420073@gmail.com (mailing list archive)
State New, archived
Headers show
Series net: avoid to remove module when its debugfs is being used | expand

Commit Message

Taehee Yoo Oct. 8, 2020, 3:50 p.m. UTC
If THIS_MODULE is not set, the module would be removed while debugfs is
being used.
It eventually makes kernel panic.

Fixes: e9f207f0ff90 ("[MAC80211]: Add debugfs attributes.")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---
 net/mac80211/debugfs_netdev.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Johannes Berg Oct. 8, 2020, 4:06 p.m. UTC | #1
On Thu, 2020-10-08 at 15:50 +0000, Taehee Yoo wrote:
> If THIS_MODULE is not set, the module would be removed while debugfs is
> being used.
> It eventually makes kernel panic.
> 
Wow, 117 practically identical patches? No thanks ...

Can you merge the ones that belong to a single driver?

net/mac80211/ -> mac80211
net/wireless/ -> cfg80211

etc.

I don't think we need more than one patch for each driver/subsystem.

johannes
Kalle Valo Oct. 9, 2020, 3:09 p.m. UTC | #2
Johannes Berg <johannes@sipsolutions.net> writes:

> On Thu, 2020-10-08 at 15:50 +0000, Taehee Yoo wrote:
>> If THIS_MODULE is not set, the module would be removed while debugfs is
>> being used.
>> It eventually makes kernel panic.
>> 
> Wow, 117 practically identical patches? No thanks ...
>
> Can you merge the ones that belong to a single driver?
>
> net/mac80211/ -> mac80211
> net/wireless/ -> cfg80211
>
> etc.
>
> I don't think we need more than one patch for each driver/subsystem.

Yes, one patch per driver is much better. And never send 100 patches in
one go, I will automatically drop these even without looking.
diff mbox series

Patch

diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index fe8a7a87e513..8efa31ae7334 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -127,6 +127,7 @@  static const struct file_operations name##_ops = {			\
 	.write = (_write),						\
 	.open = simple_open,						\
 	.llseek = generic_file_llseek,					\
+	.owner = THIS_MODULE,						\
 }
 
 #define _IEEE80211_IF_FILE_R_FN(name)					\