vti: Simplify error handling in module init and exit
authorMathias Krause <minipli@googlemail.com>
Fri, 9 May 2014 21:43:42 +0000 (23:43 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Thu, 26 Jun 2014 06:21:57 +0000 (08:21 +0200)
commit1990e4f883a6383b04ef37f32bdaa02dc0dbae8d
tree10df5de557e665e09809dbdf84b0938a68d5a72f
parente59d82fd33f7670cf67fd69cf684aa589ec8340a
vti: Simplify error handling in module init and exit

The error handling in the module init and exit functions can be
shortened to safe us some code.

1/ Remove the code duplications in the init function, jump straight to
the existing cleanup code by adding some labels. Also give the error
message some more value by telling the reason why loading the module has
failed. Furthermore fix the "IPSec" typo -- it should be "IPsec" instead.

2/ Remove the error handling in the exit function as the only legitimate
reason xfrm4_protocol_deregister() might fail is inet_del_protocol()
returning -1. That, in turn, means some other protocol handler had been
registered for this very protocol in the meantime. But that essentially
means we haven't been handling that protocol any more, anyway. What it
definitely means not is that we "can't deregister tunnel". Therefore
just get rid of that bogus warning. It's plain wrong.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/ipv4/ip_vti.c
This page took 0.025429 seconds and 5 git commands to generate.