ChangeSet 1.2187, 2005/03/19 01:32:29-06:00, [EMAIL PROTECTED](none)

        [CIFS] remove redundant null pointer checks before kfrees
        
        Signed-off-by: Jesper Juhl  ([EMAIL PROTECTED])
        Signed-off-by: Steve French ([EMAIL PROTECTED])



 file.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)


diff -Nru a/fs/cifs/file.c b/fs/cifs/file.c
--- a/fs/cifs/file.c    2005-03-30 12:07:41 -08:00
+++ b/fs/cifs/file.c    2005-03-30 12:07:41 -08:00
@@ -148,8 +148,7 @@
        able to simply do a filemap_fdatawrite/filemap_fdatawait first */
        buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
        if (buf == NULL) {
-               if (full_path)
-                       kfree(full_path);
+               kfree(full_path);
                FreeXid(xid);
                return -ENOMEM;
        }
@@ -248,10 +247,8 @@
                }
        }
 
-       if (buf)
-               kfree(buf);
-       if (full_path)
-               kfree(full_path);
+       kfree(buf);
+       kfree(full_path);
        FreeXid(xid);
        return rc;
 }
@@ -342,8 +339,7 @@
 /*     buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
        if (buf == 0) {
                up(&pCifsFile->fh_sem);
-               if (full_path)
-                       kfree(full_path);
+               kfree(full_path);
                FreeXid(xid);
                return -ENOMEM;
        } */
@@ -396,8 +392,7 @@
                }
        }
 
-       if (full_path)
-               kfree(full_path);
+       kfree(full_path);
        FreeXid(xid);
        return rc;
 }
@@ -431,8 +426,7 @@
                list_del(&pSMBFile->flist);
                list_del(&pSMBFile->tlist);
                write_unlock(&file->f_owner.lock);
-               if (pSMBFile->search_resume_name)
-                       kfree(pSMBFile->search_resume_name);
+               kfree(pSMBFile->search_resume_name);
                kfree(file->private_data);
                file->private_data = NULL;
        } else
-
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