From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Steven Whitehouse <swhiteho@redhat.com>
Cc: cluster-devel@redhat.com, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: [PATCH] gfs2: Fix refcnt leak on gfs2_follow_link() error path
Date: Tue, 12 Jan 2010 03:36:57 +0900 [thread overview]
Message-ID: <87iqb8jxo6.fsf@devron.myhome.or.jp> (raw)
If ->follow_link handler return the error, it should decrement
nd->path refcnt.
This patch fix it.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---
fs/gfs2/ops_inode.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff -puN fs/gfs2/ops_inode.c~namei-gfs2-follow_link-fix fs/gfs2/ops_inode.c
--- linux-2.6/fs/gfs2/ops_inode.c~namei-gfs2-follow_link-fix 2010-01-12 00:15:12.000000000 +0900
+++ linux-2.6-hirofumi/fs/gfs2/ops_inode.c 2010-01-12 00:15:12.000000000 +0900
@@ -1086,7 +1086,8 @@ static void *gfs2_follow_link(struct den
error = vfs_follow_link(nd, buf);
if (buf != array)
kfree(buf);
- }
+ } else
+ path_put(&nd->path);
return ERR_PTR(error);
}
_
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
next reply other threads:[~2010-01-11 18:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-11 18:36 OGAWA Hirofumi [this message]
2010-01-12 9:51 ` [PATCH] gfs2: Fix refcnt leak on gfs2_follow_link() error path Steven Whitehouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87iqb8jxo6.fsf@devron.myhome.or.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=cluster-devel@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=swhiteho@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox