Message ID | 20191220070724.27660-1-yihuaijie@huawei.com |
---|---|
State | New |
Delegated to: | David Woodhouse |
Headers | show |
Series | jffs2: fix kfree uninitialized pointer in jffs2_i_callback | expand |
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index ef1cfa61549e..625c4da3246d 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h @@ -54,7 +54,6 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f) f->fragtree = RB_ROOT; f->metadata = NULL; f->dents = NULL; - f->target = NULL; f->flags = 0; f->usercompr = 0; } diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c index 0e6406c4f362..d76ed98057a1 100644 --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c @@ -42,6 +42,8 @@ static struct inode *jffs2_alloc_inode(struct super_block *sb) f = kmem_cache_alloc(jffs2_inode_cachep, GFP_KERNEL); if (!f) return NULL; + f->target = NULL; + return &f->vfs_inode; }