]> git.itanic.dy.fi Git - linux-stable/commitdiff
fix struct file leakage
authorKirill Korotaev <dev@sw.ru>
Wed, 30 Aug 2006 20:55:59 +0000 (22:55 +0200)
committerAdrian Bunk <bunk@stusta.de>
Wed, 30 Aug 2006 20:55:59 +0000 (22:55 +0200)
2.6.16 leaks like hell. While testing, I found massive filp leakage
(reproduced in openvz) in the bowels of namei.c.

Signed-off-by: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
fs/namei.c

index f11c0aa2293891a08c90a733e4d13ec4d8da59e6..3ece3a93dd926c9c2ddf22168125bf9532586d98 100644 (file)
@@ -1708,8 +1708,14 @@ int open_namei(int dfd, const char *pathname, int flag,
        if (error)
                goto exit_dput;
        error = __do_follow_link(&path, nd);
-       if (error)
+       if (error) {
+               /* Does someone understand code flow here? Or it is only
+                * me so stupid? Anathema to whoever designed this non-sense
+                * with "intent.open".
+                */
+               release_open_intent(nd);
                return error;
+       }
        nd->flags &= ~LOOKUP_PARENT;
        if (nd->last_type == LAST_BIND)
                goto ok;