quota: Drop path reference on error exit from quotactl
authorJan Kara <jack@suse.cz>
Mon, 10 Oct 2011 16:32:06 +0000 (18:32 +0200)
committerJan Kara <jack@suse.cz>
Mon, 31 Oct 2011 22:43:59 +0000 (23:43 +0100)
One error exit from quotactl forgot to do path_put(). Fix that.

Reported-by: Valerie Aurora <val@vaaconsulting.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/quota/quota.c

index b34bdb2..a18ef46 100644 (file)
@@ -363,12 +363,15 @@ SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special,
        }
 
        sb = quotactl_block(special);
-       if (IS_ERR(sb))
-               return PTR_ERR(sb);
+       if (IS_ERR(sb)) {
+               ret = PTR_ERR(sb);
+               goto out;
+       }
 
        ret = do_quotactl(sb, type, cmds, id, addr, pathp);
 
        drop_super(sb);
+out:
        if (pathp && !IS_ERR(pathp))
                path_put(pathp);
        return ret;