diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 10:14:23 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 10:14:23 -0700 |
commit | 33217379becdee25021cabb25032b3bf703d0e96 (patch) | |
tree | 27cfbb722a523950ec8c9f616f28a1767498601a /fs/nfsd/vfs.c | |
parent | feeedc6c820e1026453ad865076cee435f24d30a (diff) | |
parent | 30bc4dfd3b64eb1fbefe2c63e30d8fc129273e20 (diff) |
Merge branch 'for-2.6.28' of git://linux-nfs.org/~bfields/linux
* 'for-2.6.28' of git://linux-nfs.org/~bfields/linux:
nfsd: clean up expkey_parse error cases
nfsd: Drop reference in expkey_parse error cases
nfsd: Fix memory leak in nfsd_getxattr
NFSD: Fix BUG during NFSD shutdown processing
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r-- | fs/nfsd/vfs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index aa1d0d6489a..9609eb51d72 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -410,6 +410,7 @@ out_nfserr: static ssize_t nfsd_getxattr(struct dentry *dentry, char *key, void **buf) { ssize_t buflen; + ssize_t ret; buflen = vfs_getxattr(dentry, key, NULL, 0); if (buflen <= 0) @@ -419,7 +420,10 @@ static ssize_t nfsd_getxattr(struct dentry *dentry, char *key, void **buf) if (!*buf) return -ENOMEM; - return vfs_getxattr(dentry, key, *buf, buflen); + ret = vfs_getxattr(dentry, key, *buf, buflen); + if (ret < 0) + kfree(*buf); + return ret; } #endif |