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

Taehee Yoo ap420073 at gmail.com
Thu Oct 8 11:52:00 EDT 2020


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 at 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




More information about the b43-dev mailing list