ChangeSet 1.2229.1.22, 2005/04/04 07:40:04-07:00, [EMAIL PROTECTED]

        [PATCH] kfree() NULL pointer cleanups - no need to check - fs/ext3/
        
        kfree() handles NULL pointers fine - checking is redundant.
        
        Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]>
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>



 acl.c   |    6 ++----
 super.c |   12 ++++--------
 2 files changed, 6 insertions(+), 12 deletions(-)


diff -Nru a/fs/ext3/acl.c b/fs/ext3/acl.c
--- a/fs/ext3/acl.c     2005-04-04 08:18:38 -07:00
+++ b/fs/ext3/acl.c     2005-04-04 08:18:38 -07:00
@@ -197,8 +197,7 @@
                acl = NULL;
        else
                acl = ERR_PTR(retval);
-       if (value)
-               kfree(value);
+       kfree(value);
 
        if (!IS_ERR(acl)) {
                switch(type) {
@@ -267,8 +266,7 @@
        error = ext3_xattr_set_handle(handle, inode, name_index, "",
                                      value, size, 0);
 
-       if (value)
-               kfree(value);
+       kfree(value);
        if (!error) {
                switch(type) {
                        case ACL_TYPE_ACCESS:
diff -Nru a/fs/ext3/super.c b/fs/ext3/super.c
--- a/fs/ext3/super.c   2005-04-04 08:18:38 -07:00
+++ b/fs/ext3/super.c   2005-04-04 08:18:38 -07:00
@@ -395,10 +395,8 @@
        percpu_counter_destroy(&sbi->s_dirs_counter);
        brelse(sbi->s_sbh);
 #ifdef CONFIG_QUOTA
-       for (i = 0; i < MAXQUOTAS; i++) {
-               if (sbi->s_qf_names[i])
-                       kfree(sbi->s_qf_names[i]);
-       }
+       for (i = 0; i < MAXQUOTAS; i++)
+               kfree(sbi->s_qf_names[i]);
 #endif
 
        /* Debugging code just in case the in-memory inode orphan list
@@ -883,10 +881,8 @@
                                        "quota turned on.\n");
                                return 0;
                        }
-                       if (sbi->s_qf_names[qtype]) {
-                               kfree(sbi->s_qf_names[qtype]);
-                               sbi->s_qf_names[qtype] = NULL;
-                       }
+                       kfree(sbi->s_qf_names[qtype]);
+                       sbi->s_qf_names[qtype] = NULL;
                        break;
                case Opt_jqfmt_vfsold:
                        sbi->s_jquota_fmt = QFMT_VFS_OLD;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to