aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/gfs2/xattr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c
index 71d7bf830c09..a201a1d57a6d 100644
--- a/fs/gfs2/xattr.c
+++ b/fs/gfs2/xattr.c
@@ -549,9 +549,10 @@ int gfs2_xattr_acl_get(struct gfs2_inode *ip, const char *name, char **ppdata)
549 goto out; 549 goto out;
550 550
551 error = gfs2_ea_get_copy(ip, &el, data, len); 551 error = gfs2_ea_get_copy(ip, &el, data, len);
552 if (error == 0) 552 if (error < 0)
553 error = len; 553 kfree(data);
554 *ppdata = data; 554 else
555 *ppdata = data;
555out: 556out:
556 brelse(el.el_bh); 557 brelse(el.el_bh);
557 return error; 558 return error;