Parcourir la source

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

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>
Wei Yongjun il y a 16 ans
Parent
commit
3384901f1b
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      net/802/tr.c

+ 3 - 0
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;
 }