Skip to content

Commit a5bbcbf

Browse files
TaeheeYookuba-moo
authored andcommitted
netdevsim: set .owner to THIS_MODULE
If THIS_MODULE is not set, the module would be removed while debugfs is being used. It eventually makes kernel panic. Fixes: 82c93a8 ("netdevsim: implement couple of testing devlink health reporters") Fixes: 424be63 ("netdevsim: add UDP tunnel port offload support") Fixes: 4418f86 ("netdevsim: implement support for devlink region and snapshots") Fixes: d3cbb90 ("netdevsim: add ACL trap reporting cookie as a metadata") Signed-off-by: Taehee Yoo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent fd5736b commit a5bbcbf

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

drivers/net/netdevsim/dev.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ static const struct file_operations nsim_dev_take_snapshot_fops = {
9696
.open = simple_open,
9797
.write = nsim_dev_take_snapshot_write,
9898
.llseek = generic_file_llseek,
99+
.owner = THIS_MODULE,
99100
};
100101

101102
static ssize_t nsim_dev_trap_fa_cookie_read(struct file *file,
@@ -188,6 +189,7 @@ static const struct file_operations nsim_dev_trap_fa_cookie_fops = {
188189
.read = nsim_dev_trap_fa_cookie_read,
189190
.write = nsim_dev_trap_fa_cookie_write,
190191
.llseek = generic_file_llseek,
192+
.owner = THIS_MODULE,
191193
};
192194

193195
static int nsim_dev_debugfs_init(struct nsim_dev *nsim_dev)

drivers/net/netdevsim/health.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ static const struct file_operations nsim_dev_health_break_fops = {
261261
.open = simple_open,
262262
.write = nsim_dev_health_break_write,
263263
.llseek = generic_file_llseek,
264+
.owner = THIS_MODULE,
264265
};
265266

266267
int nsim_dev_health_init(struct nsim_dev *nsim_dev, struct devlink *devlink)

drivers/net/netdevsim/udp_tunnels.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ static const struct file_operations nsim_udp_tunnels_info_reset_fops = {
124124
.open = simple_open,
125125
.write = nsim_udp_tunnels_info_reset_write,
126126
.llseek = generic_file_llseek,
127+
.owner = THIS_MODULE,
127128
};
128129

129130
int nsim_udp_tunnels_info_create(struct nsim_dev *nsim_dev,

0 commit comments

Comments
 (0)