aboutsummaryrefslogtreecommitdiff
path: root/fs/cifs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-10-14 10:10:45 +0200
committerAdrian Bunk <bunk@stusta.de>2006-10-14 10:10:45 +0200
commite0326df174d475bdd3da6d0a8730af3a7a347e61 (patch)
tree2bdaa7e332c88ef1d3300eec1ed74472845225b2 /fs/cifs
parentcffa5ffe7214563e25b1cd72b229b4e6a709eb71 (diff)
[CIFS] fs/cifs/dir.c: fix possible NULL dereference
Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Adrian Bunk <bunk@stusta.de>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/dir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 5e562bc6124..749d6fb488e 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);