aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2/xattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext2/xattr.c')
-rw-r--r--fs/ext2/xattr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 529970617a21..d27b71f1d183 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -161,6 +161,10 @@ ext2_xattr_get(struct inode *inode, int name_index, const char *name,
161 161
162 if (name == NULL) 162 if (name == NULL)
163 return -EINVAL; 163 return -EINVAL;
164 name_len = strlen(name);
165 if (name_len > 255)
166 return -ERANGE;
167
164 down_read(&EXT2_I(inode)->xattr_sem); 168 down_read(&EXT2_I(inode)->xattr_sem);
165 error = -ENODATA; 169 error = -ENODATA;
166 if (!EXT2_I(inode)->i_file_acl) 170 if (!EXT2_I(inode)->i_file_acl)
@@ -181,12 +185,8 @@ bad_block: ext2_error(inode->i_sb, "ext2_xattr_get",
181 error = -EIO; 185 error = -EIO;
182 goto cleanup; 186 goto cleanup;
183 } 187 }
184 /* find named attribute */
185 name_len = strlen(name);
186 188
187 error = -ERANGE; 189 /* find named attribute */
188 if (name_len > 255)
189 goto cleanup;
190 entry = FIRST_ENTRY(bh); 190 entry = FIRST_ENTRY(bh);
191 while (!IS_LAST_ENTRY(entry)) { 191 while (!IS_LAST_ENTRY(entry)) {
192 struct ext2_xattr_entry *next = 192 struct ext2_xattr_entry *next =