diff options
Diffstat (limited to 'fs/nfsd')
-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 aa1d0d6489a1..9609eb51d727 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -410,6 +410,7 @@ out_nfserr: | |||
410 | static ssize_t nfsd_getxattr(struct dentry *dentry, char *key, void **buf) | 410 | static ssize_t nfsd_getxattr(struct dentry *dentry, char *key, void **buf) |
411 | { | 411 | { |
412 | ssize_t buflen; | 412 | ssize_t buflen; |
413 | ssize_t ret; | ||
413 | 414 | ||
414 | buflen = vfs_getxattr(dentry, key, NULL, 0); | 415 | buflen = vfs_getxattr(dentry, key, NULL, 0); |
415 | if (buflen <= 0) | 416 | if (buflen <= 0) |
@@ -419,7 +420,10 @@ static ssize_t nfsd_getxattr(struct dentry *dentry, char *key, void **buf) | |||
419 | if (!*buf) | 420 | if (!*buf) |
420 | return -ENOMEM; | 421 | return -ENOMEM; |
421 | 422 | ||
422 | return vfs_getxattr(dentry, key, *buf, buflen); | 423 | ret = vfs_getxattr(dentry, key, *buf, buflen); |
424 | if (ret < 0) | ||
425 | kfree(*buf); | ||
426 | return ret; | ||
423 | } | 427 | } |
424 | #endif | 428 | #endif |
425 | 429 | ||