aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-11-11 18:24:06 -0500
committerSage Weil <sage@newdream.net>2010-11-11 18:24:06 -0500
commita1629c3b24f26ec1b0f534874af674a6b4c1540b (patch)
tree7b40b54486f68189cde9753aca31d8e3d8af61a2 /fs
parentc5c6b19d4b8f5431fca05f28ae9e141045022149 (diff)
ceph: fix dangling pointer
Clear fi->last_name when it's freed. The only caller is rewinddir() (or equivalent lseek). Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/dir.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index e0a2dc6fcafc..1e11ed716f85 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -414,6 +414,7 @@ static void reset_readdir(struct ceph_file_info *fi)
414 fi->last_readdir = NULL; 414 fi->last_readdir = NULL;
415 } 415 }
416 kfree(fi->last_name); 416 kfree(fi->last_name);
417 fi->last_name = NULL;
417 fi->next_offset = 2; /* compensate for . and .. */ 418 fi->next_offset = 2; /* compensate for . and .. */
418 if (fi->dentry) { 419 if (fi->dentry) {
419 dput(fi->dentry); 420 dput(fi->dentry);