From: Steve French Date: Sat, 14 Oct 2006 08:10:45 +0000 (+0200) Subject: [CIFS] fs/cifs/dir.c: fix possible NULL dereference X-Git-Tag: v2.6.16.30-rc1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0326df174d475bdd3da6d0a8730af3a7a347e61;p=people%2Fms%2Flinux.git [CIFS] fs/cifs/dir.c: fix possible NULL dereference Signed-off-by: Steve French Signed-off-by: Adrian Bunk --- diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 5e562bc61245..749d6fb488e2 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -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);