提交 ec7478fa 编写于 作者: S shengyong 提交者: Brian Norris

mtd: nandsim: fix free of NULL pointer

If allocating ns->nand_pages_slab fails, do not try to destroy it when
cleaning up nandsim resources.
Signed-off-by: NSheng Yong <shengyong1@huawei.com>
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
上级 83dcf400
......@@ -649,7 +649,8 @@ static void free_device(struct nandsim *ns)
kmem_cache_free(ns->nand_pages_slab,
ns->pages[i].byte);
}
kmem_cache_destroy(ns->nand_pages_slab);
if (ns->nand_pages_slab)
kmem_cache_destroy(ns->nand_pages_slab);
vfree(ns->pages);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册