Skip to contentSkip to conversation

avoid NULL deference in ext2_xattr_get

PATCH RESEND In review crosslonelyover 1 participant 2 messages Jul 11, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 avoid NULL deference in ext2_xattr_get

Hi Dan Carpenter,

Thanks for your instructions. I regenerated the patch.
Please check it.

Quoted 1 line

From 3149865e0d118b939c27659a4e4c884eaa6b3a4c Mon Sep 17 00:00:00 2001

From: Wang Sheng-Hui <[email protected]>
Date: Sat, 10 Jul 2010 22:07:37 -0400
Subject: [PATCH] avoid NULL deference in ext2_xattr_get

---
 fs/ext2/xattr.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
fs/ext2/xattr.c +3 -2
index 7c39157..81ec1c6 100644
@@ -156,11 +156,12 @@ ext2_xattr_get(struct inode *inode, int name_index, const char *name,
 	char *end;
 	int error;
 
+	if (name == NULL)
+		return -EINVAL;
+
 	ea_idebug(inode, "name=%d.%s, buffer=%p, buffer_size=%ld",
 		  name_index, name, buffer, (long)buffer_size);
 
-	if (name == NULL)
-		return -EINVAL;
 	down_read(&EXT2_I(inode)->xattr_sem);
 	error = -ENODATA;
 	if (!EXT2_I(inode)->i_file_acl)
Signature · 1 line
1.7.1.1
author
#1 lore raw

2010/7/11 crosslonelyover <[email protected]>:

Quoted 36 lines

Hi Dan Carpenter,

    Thanks for your instructions. I regenerated the patch. Please check it.

From 3149865e0d118b939c27659a4e4c884eaa6b3a4c Mon Sep 17 00:00:00 2001
From: Wang Sheng-Hui <[email protected]>
Date: Sat, 10 Jul 2010 22:07:37 -0400
Subject: [PATCH] avoid NULL deference in ext2_xattr_get

---
 fs/ext2/xattr.c |    5 +++--

 1 files changed, 3 insertions(+), 2 deletions(-)
fs/ext2/xattr.c +3 -3
index 7c39157..81ec1c6 100644
@@ -156,11 +156,12 @@ ext2_xattr_get(struct inode *inode, int name_index, const char *name,
        char *end;
        int error;
 
+       if (name = NULL)
+               return -EINVAL;
+
        ea_idebug(inode, "name=%d.%s, buffer=%p, buffer_size=%ld",
                  name_index, name, buffer, (long)buffer_size);
 
-       if (name = NULL)
-               return -EINVAL;
        down_read(&EXT2_I(inode)->xattr_sem);
        error = -ENODATA;
        if (!EXT2_I(inode)->i_file_acl)
--
Quoted 4 lines

1.7.1.1

Please ignore this patch. Just for gmail format check. Thanks for David Beal's explanation!

Signature · 2 lines
Thanks and Best Regards,
shenghui