Skip to content

Commit

Permalink
net/can: single_open_net needs to be paired with single_release_net
Browse files Browse the repository at this point in the history
Otherwise we will leak a reference to the network namespace.

Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Christoph Hellwig committed May 14, 2018
1 parent 67b8d5c commit 441bc62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion net/can/bcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
6 changes: 3 additions & 3 deletions net/can/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
};


Expand Down Expand Up @@ -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,
};

/*
Expand Down

0 comments on commit 441bc62

Please sign in to comment.