netfilter: nfnetlink_log: fix silly refcount leak
authorAlexey Dobriyan <adobriyan@gmail.com>
Fri, 26 Feb 2010 16:48:40 +0000 (17:48 +0100)
committerPatrick McHardy <kaber@trash.net>
Fri, 26 Feb 2010 16:48:40 +0000 (17:48 +0100)
Quick fix for memory/module refcount leak.
Reference count of listener instance never reaches 0.

Start/stop of ulogd2 is enough to trigger this bug!

Now, refcounting there looks very fishy in particular this code:

  if (!try_module_get(THIS_MODULE)) {
...

and creation of listener instance with refcount 2,
so it may very well be ripped and redone.  :-)

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
net/netfilter/nfnetlink_log.c

index 285e9029a9ff4b837219bf3d0cb2db1b1a13eb00..d9b8fb8ab340b5a97e57073abdfe611f7b0c1c74 100644 (file)
@@ -768,7 +768,7 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
                        }
 
                        instance_destroy(inst);
-                       goto out;
+                       goto out_put;
                default:
                        ret = -ENOTSUPP;
                        break;