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 <ap420...@gmail.com>
---
 net/bluetooth/smp.c | 1 +
 1 file changed, 1 insertion(+)

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)
-- 
2.17.1

Reply via email to