[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1302803767-9715-90-git-send-email-paul.gortmaker@windriver.com>
Date: Thu, 14 Apr 2011 13:56:01 -0400
From: Paul Gortmaker <paul.gortmaker@...driver.com>
To: stable@...nel.org, linux-kernel@...r.kernel.org
Cc: stable-review@...nel.org, Li Zefan <lizf@...fujitsu.com>,
"J. Bruce Fields" <bfields@...ldses.org>,
Neil Brown <neilb@...e.de>,
Trond Myklebust <Trond.Myklebust@...app.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"J. Bruce Fields" <bfields@...i.umich.edu>,
Paul Gortmaker <paul.gortmaker@...driver.com>
Subject: [34-longterm 203/209] sunrpc/cache: fix module refcnt leak in a failure path
From: Li Zefan <lizf@...fujitsu.com>
=====================================================================
| This is a commit scheduled for the next v2.6.34 longterm release. |
| If you see a problem with using this for longterm, please comment.|
=====================================================================
commit a5990ea1254cd186b38744507aeec3136a0c1c95 upstream
Don't forget to release the module refcnt if seq_open() returns failure.
Signed-off-by: Li Zefan <lizf@...fujitsu.com>
Cc: J. Bruce Fields <bfields@...ldses.org>
Cc: Neil Brown <neilb@...e.de>
Cc: Trond Myklebust <Trond.Myklebust@...app.com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: J. Bruce Fields <bfields@...i.umich.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@...driver.com>
---
net/sunrpc/cache.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 39bddba..b7af6b2 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -1233,8 +1233,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;
--
1.7.4.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists