Commit e0326df1 authored by Steve French's avatar Steve French Committed by Adrian Bunk

[CIFS] fs/cifs/dir.c: fix possible NULL dereference

Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
parent cffa5ffe
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment