]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[CIFS] fs/cifs/dir.c: fix possible NULL dereference
authorSteve French <sfrench@us.ibm.com>
Sat, 14 Oct 2006 08:10:45 +0000 (10:10 +0200)
committerAdrian Bunk <bunk@stusta.de>
Sat, 14 Oct 2006 08:10:45 +0000 (10:10 +0200)
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
fs/cifs/dir.c

index 5e562bc61245da00dada25ec6f90cff4fc0b6ed0..749d6fb488e24731e47fe40372972b389b0c1737 100644 (file)
@@ -48,13 +48,14 @@ build_path_from_dentry(struct dentry *direntry)
        struct dentry *temp;
        int namelen = 0;
        char *full_path;
-       char dirsep = CIFS_DIR_SEP(CIFS_SB(direntry->d_sb));
+       char dirsep;
 
        if(direntry == NULL)
                return NULL;  /* not much we can do if dentry is freed and
                we need to reopen the file after it was closed implicitly
                when the server crashed */
 
+       dirsep = CIFS_DIR_SEP(CIFS_SB(direntry->d_sb));
 cifs_bp_rename_retry:
        for (temp = direntry; !IS_ROOT(temp);) {
                namelen += (1 + temp->d_name.len);