[PATCH 2.6.32] rfkill: fix miscdev ops

Johannes Berg
2009-11-23T10:27:36Z

The /dev/rfkill ops don't refer to the module,
so it is possible to unload the module while
file descriptors are open. Fix this oversight.

Reported-by: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/rfkill/core.c | 1 +
1 file changed, 1 insertion(+)

--- wireless-testing.orig/net/rfkill/core.c 2009-11-23 11:11:13.000000000 +0100
+++ wireless-testing/net/rfkill/core.c 2009-11-23 11:11:59.000000000 +0100
@@ -1191,6 +1191,7 @@ static long rfkill_fop_ioctl(struct file
#endif

static const struct file_operations rfkill_fops = {
+ .owner = THIS_MODULE,
.open = rfkill_fop_open,
.read = rfkill_fop_read,
.write = rfkill_fop_write,