|
@@ -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
|
|
|
|