From: Sage Weil Date: Thu, 11 Nov 2010 23:24:06 +0000 (-0800) Subject: ceph: fix dangling pointer X-Git-Tag: v3.0~2770^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1629c3b24f26ec1b0f534874af674a6b4c1540b;p=platform%2Fkernel%2Flinux-amlogic.git 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 --- diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index e0a2dc6..1e11ed7 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -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);