]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
NET: net_namespace, fix lock imbalance
authorJiri Slaby <jirislaby@gmail.com>
Sat, 17 Jan 2009 06:47:12 +0000 (06:47 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Feb 2009 17:53:29 +0000 (09:53 -0800)
commit 357f5b0b91054ae23385ea4b0634bb8b43736e83 upstream.

register_pernet_gen_subsys omits mutex_unlock in one fail path.
Fix it.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/core/net_namespace.c

index 1895a4ca9c4f7878467afee19ab714f072c76d57..0bc398c407f461a95bd9ec67592ee71cc1e31e55 100644 (file)
@@ -342,8 +342,8 @@ again:
        rv = register_pernet_operations(first_device, ops);
        if (rv < 0)
                ida_remove(&net_generic_ids, *id);
-       mutex_unlock(&net_mutex);
 out:
+       mutex_unlock(&net_mutex);
        return rv;
 }
 EXPORT_SYMBOL_GPL(register_pernet_gen_subsys);