Skip to content

Commit 441bc62

Browse files
author
Christoph Hellwig
committed
net/can: single_open_net needs to be paired with single_release_net
Otherwise we will leak a reference to the network namespace. Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 67b8d5c commit 441bc62

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎net/can/bcm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ static const struct file_operations bcm_proc_fops = {
249249
.open = bcm_proc_open,
250250
.read = seq_read,
251251
.llseek = seq_lseek,
252-
.release = single_release,
252+
.release = single_release_net,
253253
};
254254
#endif /* CONFIG_PROC_FS */
255255

‎net/can/proc.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static const struct file_operations can_stats_proc_fops = {
279279
.open = can_stats_proc_open,
280280
.read = seq_read,
281281
.llseek = seq_lseek,
282-
.release = single_release,
282+
.release = single_release_net,
283283
};
284284

285285
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 = {
449449
.open = can_rcvlist_sff_proc_open,
450450
.read = seq_read,
451451
.llseek = seq_lseek,
452-
.release = single_release,
452+
.release = single_release_net,
453453
};
454454

455455

@@ -492,7 +492,7 @@ static const struct file_operations can_rcvlist_eff_proc_fops = {
492492
.open = can_rcvlist_eff_proc_open,
493493
.read = seq_read,
494494
.llseek = seq_lseek,
495-
.release = single_release,
495+
.release = single_release_net,
496496
};
497497

498498
/*

0 commit comments

Comments
 (0)