datapath: Add owner to file_operations declaration.
authorJesse Gross <jesse@nicira.com>
Wed, 29 Dec 2010 22:10:50 +0000 (14:10 -0800)
committerJesse Gross <jesse@nicira.com>
Thu, 30 Dec 2010 17:28:49 +0000 (09:28 -0800)
It's currently possible for operations on our character device to
be still running when we unload the module.  This will result in
an oops when the executing code is suddenly freed.  The chrdev
code has a way to avoid this by taking a reference on the module
every time the device is opened, which means that we can't be
unloaded as long as there is an open file descriptor and therefore
the possibility of an operation.  However, our file_operations
structure doesn't include an owner member, which prevents this
mechanism from working.  This adds one.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/datapath.c

index 1bf0520..67f6730 100644 (file)
@@ -1989,6 +1989,7 @@ static unsigned int openvswitch_poll(struct file *file, poll_table *wait)
 }
 
 static struct file_operations openvswitch_fops = {
+       .owner = THIS_MODULE,
        .read  = openvswitch_read,
        .poll  = openvswitch_poll,
        .unlocked_ioctl = openvswitch_ioctl,