summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2010-03-11 14:08:10 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2011-03-02 09:46:44 -0500
commitfe20aa6ef8389723f01d6bcbb000d14646741241 (patch)
tree90890dc0f6a94d7d463de437d5901493c405dd4a /net
parent5a4cce8c4489c6a270f37aa198c22ad9988ee8ab (diff)
sunrpc/cache: fix module refcnt leak in a failure path
commit a5990ea1254cd186b38744507aeec3136a0c1c95 upstream. Don't forget to release the module refcnt if seq_open() returns failure. 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> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Cc: maximilian attems <max@stro.at> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/cache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index d6eee291a0e2..25f7801e0ab9 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -1234,8 +1234,10 @@ static int content_open(struct inode *inode, struct file *file,
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;