diff mbox series

[net,108/117] Bluetooth: set force_bredr_smp_fops.owner to THIS_MODULE

Message ID 20201008155209.18025-108-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:52 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: 300acfdec916 ("Bluetooth: Introduce force_bredr_smp debugfs option for testing")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---
 net/bluetooth/smp.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index bf4bef13d935..9b96a2d85e86 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -3407,6 +3407,7 @@  static const struct file_operations force_bredr_smp_fops = {
 	.read		= force_bredr_smp_read,
 	.write		= force_bredr_smp_write,
 	.llseek		= default_llseek,
+	.owner		= THIS_MODULE,
 };
 
 int smp_register(struct hci_dev *hdev)