From: John Dykstra Date: Wed, 11 Mar 2009 16:22:51 +0000 (-0700) Subject: ipv6: Fix BUG when disabled ipv6 module is unloaded X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ff8cf9a93800e8118ea097c1aba7203d59a0f3f1;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git ipv6: Fix BUG when disabled ipv6 module is unloaded Do not try to "uninitialize" ipv6 if its initialization had been skipped because module parameter disable=1 had been specified. Reported-by: Thomas Backlund Signed-off-by: John Dykstra Acked-by: Brian Haley Signed-off-by: David S. Miller --- diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index da944eca2ca6..9c8309ed35cf 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c @@ -1192,6 +1192,9 @@ module_init(inet6_init); static void __exit inet6_exit(void) { + if (disable_ipv6) + return; + /* First of all disallow new sockets creation. */ sock_unregister(PF_INET6); /* Disallow any further netlink messages */