diff mbox

[2/2] ceph: fix use-after-free bug

Message ID 1380371685-11577-2-git-send-email-zheng.z.yan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yan, Zheng Sept. 28, 2013, 12:34 p.m. UTC
From: "Yan, Zheng" <zheng.z.yan@intel.com>

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 fs/ceph/inode.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 6f0a35c..2ae1381 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -779,6 +779,7 @@  no_change:
 			rb_node = rb_next(rb_node);
 			rb_erase(&frag->node, &ci->i_fragtree);
 			kfree(frag);
+			frag = NULL;
 		}
 		if (!frag) {
 			frag = __get_or_create_frag(ci, id);