l2tp: consistent reference counting in procfs and debufs
authorGuillaume Nault <g.nault@alphalink.fr>
Wed, 25 Apr 2018 17:54:14 +0000 (19:54 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Apr 2018 15:06:35 +0000 (11:06 -0400)
commit834944073301e85001c3ed9913027ca47c6f889b
treedeb655628c17910683936af73a8b510992404ff2
parent3e5cf362c34b14c8d01d19d4b821fb35e1779862
l2tp: consistent reference counting in procfs and debufs

The 'pppol2tp' procfs and 'l2tp/tunnels' debugfs files handle reference
counting of sessions differently than for tunnels.

For consistency, use the same mechanism for handling both sessions and
tunnels. That is, drop the reference on the previous session just
before looking up the next one (rather than in .show()). If necessary
(if dump stops before *_next_session() returns NULL), drop the last
reference in .stop().

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_debugfs.c
net/l2tp/l2tp_ppp.c