Skip to content

Commit

Permalink
ceph: fix dangling pointer
Browse files Browse the repository at this point in the history
Clear fi->last_name when it's freed.  The only caller is rewinddir() (or
equivalent lseek).

Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Sage Weil committed Nov 11, 2010
1 parent c5c6b19 commit a1629c3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/ceph/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ static void reset_readdir(struct ceph_file_info *fi)
fi->last_readdir = NULL;
}
kfree(fi->last_name);
fi->last_name = NULL;
fi->next_offset = 2; /* compensate for . and .. */
if (fi->dentry) {
dput(fi->dentry);
Expand Down

0 comments on commit a1629c3

Please sign in to comment.