diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 32102d1ed4cd..3eec23ac5ab1 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c @@ -345,7 +345,7 @@ again: goto again; } - if (tunnel && tunnel->tunnel_id == tid && + if (tunnel->tunnel_id == tid && refcount_inc_not_zero(&session->ref_count)) { rcu_read_unlock_bh(); return session;