]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/core/dev_mcast.c
[NET]: Fix race when opening a proc file while a network namespace is exiting.
[linux-2.6-omap-h63xx.git] / net / core / dev_mcast.c
index 1c4f6198459b80ea4cc5ef699fc1861aacc2b13e..896b0ca5aed7c63b19ddc007ad402832bf66a8f6 100644 (file)
@@ -246,7 +246,11 @@ static int dev_mc_seq_open(struct inode *inode, struct file *file)
        res = seq_open(file, &dev_mc_seq_ops);
        if (!res) {
                seq = file->private_data;
-               seq->private = get_net(PROC_NET(inode));
+               seq->private = get_proc_net(inode);
+               if (!seq->private) {
+                       seq_release(inode, file);
+                       res = -ENXIO;
+               }
        }
        return res;
 }