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)
ipip_tunnel_setup);
if (!ipip_fb_tunnel_dev) {
err = -ENOMEM;
goto fail;
goto err1;
}
ipip_fb_tunnel_dev->init = ipip_fb_tunnel_init;
if ((err = register_netdev(ipip_fb_tunnel_dev)))
goto fail;
goto err2;
out:
return err;
fail:
xfrm4_tunnel_deregister(&ipip_handler);
err2:
free_netdev(ipip_fb_tunnel_dev);
err1:
xfrm4_tunnel_deregister(&ipip_handler);
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