Commit 277eefc4 authored by Patrick McHardy's avatar Patrick McHardy

[IPV4]: Fix free_netdev after failed alloc_netdev in ipip_init

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent e86d3703
...@@ -876,18 +876,19 @@ static int __init ipip_init(void) ...@@ -876,18 +876,19 @@ static int __init ipip_init(void)
ipip_tunnel_setup); ipip_tunnel_setup);
if (!ipip_fb_tunnel_dev) { if (!ipip_fb_tunnel_dev) {
err = -ENOMEM; err = -ENOMEM;
goto fail; goto err1;
} }
ipip_fb_tunnel_dev->init = ipip_fb_tunnel_init; ipip_fb_tunnel_dev->init = ipip_fb_tunnel_init;
if ((err = register_netdev(ipip_fb_tunnel_dev))) if ((err = register_netdev(ipip_fb_tunnel_dev)))
goto fail; goto err2;
out: out:
return err; return err;
fail: err2:
xfrm4_tunnel_deregister(&ipip_handler);
free_netdev(ipip_fb_tunnel_dev); free_netdev(ipip_fb_tunnel_dev);
err1:
xfrm4_tunnel_deregister(&ipip_handler);
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment