tr: fix leakage of device in net/802/tr.c
authorWei Yongjun <yjwei@cn.fujitsu.com>
Wed, 8 Apr 2009 21:27:28 +0000 (21:27 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 11 Apr 2009 08:43:17 +0000 (01:43 -0700)
Add dev_put() after dev_get_by_index() to avoid leakage
of device.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/802/tr.c

index e7eb13084d71945a83b4d5064515e53653d43fea..e874447ad144338a939e9515f3c9b4418a20ce8c 100644 (file)
@@ -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;
 }