aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2010-03-11 14:08:10 -0800
committerWilly Tarreau <w@1wt.eu>2011-04-30 16:53:05 +0200
commita3551c1c874fbc3a576ffc88541f686422d18c21 (patch)
tree0b21c6cba23fce8b2ed1eb0b5689aa6e911a8e91 /net
parent2568ab65802cb7e776a75a6f89e9e84565b3aef1 (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 c9966713282..de1d0bfd6dd 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -1252,8 +1252,10 @@ static int content_open(struct inode *inode, struct file *file)
struct cache_detail *cd = PDE(inode)->data;
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;