OSDN Git Service

net/can: single_open_net needs to be paired with single_release_net
authorChristoph Hellwig <hch@lst.de>
Wed, 11 Apr 2018 10:16:13 +0000 (12:16 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 14 May 2018 14:13:41 +0000 (16:13 +0200)
Otherwise we will leak a reference to the network namespace.

Signed-off-by: Christoph Hellwig <hch@lst.de>
net/can/bcm.c
net/can/proc.c

index ac5e5e3..8073fa1 100644 (file)
@@ -249,7 +249,7 @@ static const struct file_operations bcm_proc_fops = {
        .open           = bcm_proc_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
-       .release        = single_release,
+       .release        = single_release_net,
 };
 #endif /* CONFIG_PROC_FS */
 
index fdf704e..fde2fd5 100644 (file)
@@ -279,7 +279,7 @@ static const struct file_operations can_stats_proc_fops = {
        .open           = can_stats_proc_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
-       .release        = single_release,
+       .release        = single_release_net,
 };
 
 static int can_reset_stats_proc_show(struct seq_file *m, void *v)
@@ -449,7 +449,7 @@ static const struct file_operations can_rcvlist_sff_proc_fops = {
        .open           = can_rcvlist_sff_proc_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
-       .release        = single_release,
+       .release        = single_release_net,
 };
 
 
@@ -492,7 +492,7 @@ static const struct file_operations can_rcvlist_eff_proc_fops = {
        .open           = can_rcvlist_eff_proc_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
-       .release        = single_release,
+       .release        = single_release_net,
 };
 
 /*