From: "J. Bruce Fields" <bfields@fieldses.org>
To: akpm@linux-foundation.org
Cc: trond.myklebust@fys.uio.no, linux-nfs@vger.kernel.org,
lizf@cn.fujitsu.com, Trond.Myklebust@netapp.com, neilb@suse.de
Subject: Re: [patch 2/2] sunrpc/cache: fix module refcnt leak in a failure path
Date: Wed, 24 Mar 2010 10:43:41 -0400 [thread overview]
Message-ID: <20100324144341.GH12057@fieldses.org> (raw)
In-Reply-To: <201003112208.o2BM8Bng013520-AB4EexQrvXRQetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
On Thu, Mar 11, 2010 at 02:08:10PM -0800, akpm@linux-foundation.org wrote:
> From: Li Zefan <lizf@cn.fujitsu.com>
>
> Don't forget to release the module refcnt if seq_open() returns failure.
Thanks, applied for 2.6.35.--b.
>
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> Cc: J. Bruce Fields <bfields@fieldses.org>
> Cc: Neil Brown <neilb@suse.de>
> Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> net/sunrpc/cache.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff -puN net/sunrpc/cache.c~sunrpc-cache-fix-module-refcnt-leak-in-a-failure-path net/sunrpc/cache.c
> --- a/net/sunrpc/cache.c~sunrpc-cache-fix-module-refcnt-leak-in-a-failure-path
> +++ a/net/sunrpc/cache.c
> @@ -1233,8 +1233,10 @@ static int content_open(struct inode *in
> if (!cd || !try_module_get(cd->owner))
> return -EACCES;
> han = __seq_open_private(file, &cache_content_op, sizeof(*han));
> - if (han == NULL)
> + if (han == NULL) {
> + module_put(cd->owner);
> return -ENOMEM;
> + }
>
> han->cd = cd;
> return 0;
> _
prev parent reply other threads:[~2010-03-24 14:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-11 22:08 [patch 2/2] sunrpc/cache: fix module refcnt leak in a failure path akpm
[not found] ` <201003112208.o2BM8Bng013520-AB4EexQrvXRQetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
2010-03-24 14:43 ` J. Bruce Fields [this message]
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=20100324144341.GH12057@fieldses.org \
--to=bfields@fieldses.org \
--cc=Trond.Myklebust@netapp.com \
--cc=akpm@linux-foundation.org \
--cc=linux-nfs@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=neilb@suse.de \
--cc=trond.myklebust@fys.uio.no \
/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