datapath: Add owner to file_operations declaration.
[sliver-openvswitch.git] / datapath / datapath.c
index 87b2a05..67f6730 100644 (file)
@@ -318,9 +318,11 @@ static int destroy_dp(int dp_idx)
        dp = get_dp(dp_idx);
        if (!dp) {
                err = -ENODEV;
-               goto unlock;
+               goto out;
        }
 
+       mutex_lock(&dp->mutex);
+
        list_for_each_entry_safe (p, n, &dp->port_list, node)
                if (p->port_no != ODPP_LOCAL)
                        dp_detach_port(p);
@@ -336,10 +338,11 @@ static int destroy_dp(int dp_idx)
                skb_queue_purge(&dp->queues[i]);
        free_percpu(dp->stats_percpu);
 
+       mutex_unlock(&dp->mutex);
        kobject_put(&dp->ifobj);
        module_put(THIS_MODULE);
 
-unlock:
+out:
        mutex_unlock(&dp_mutex);
        rtnl_unlock();
        return err;
@@ -1986,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,