l2tp: remove useless duplicate session detection in l2tp_netlink
authorGuillaume Nault <g.nault@alphalink.fr>
Thu, 21 May 2020 23:57:24 +0000 (00:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 May 2020 14:40:30 +0000 (16:40 +0200)
commit263afb2e4cfc69131c563edfc84c1f92b0bbcd2f
tree6c2b57c9a547c00e3270a9c71fafb59e961f2943
parent83fc9ba9f1abc77abd083cdd479182c140625b98
l2tp: remove useless duplicate session detection in l2tp_netlink

commit af87ae465abdc070de0dc35d6c6a9e7a8cd82987 upstream.

There's no point in checking for duplicate sessions at the beginning of
l2tp_nl_cmd_session_create(); the ->session_create() callbacks already
return -EEXIST when the session already exists.

Furthermore, even if l2tp_session_find() returns NULL, a new session
might be created right after the test. So relying on ->session_create()
to avoid duplicate session is the only sane behaviour.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/l2tp/l2tp_netlink.c