Patchwork tr: fix leakage of device in net/802/tr.c

login
register
mail settings
Submitter Wei Yongjun
Date April 9, 2009, 7:27 a.m.
Message ID <49DDA360.1010402@cn.fujitsu.com>
Download mbox | patch
Permalink /patch/25768/
State Accepted
Delegated to: David Miller
Headers show

Comments

Wei Yongjun - April 9, 2009, 7:27 a.m.
Add dev_put() after dev_get_by_index() to avoid leakage
of device.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/802/tr.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Patch

diff --git a/net/802/tr.c b/net/802/tr.c
index e7eb130..e874447 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -561,6 +561,9 @@  static int rif_seq_show(struct seq_file *seq, void *v)
 				}
 				seq_putc(seq, '\n');
 			}
+
+		if (dev)
+			dev_put(dev);
 		}
 	return 0;
 }