projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
83dcf40
)
mtd: nandsim: fix free of NULL pointer
author
shengyong
<shengyong1@huawei.com>
Thu, 25 Jun 2015 02:23:13 +0000
(
02:23
+0000)
committer
Brian Norris
<computersforpeace@gmail.com>
Mon, 6 Jul 2015 22:20:09 +0000
(15:20 -0700)
If allocating ns->nand_pages_slab fails, do not try to destroy it when
cleaning up nandsim resources.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/nandsim.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/mtd/nand/nandsim.c
b/drivers/mtd/nand/nandsim.c
index 52c0c1a3899cd1d09bd4d5d9685405be04deaab5..6a74f62a00337b6093ab1f43d8d441c0605b02c9 100644
(file)
--- a/
drivers/mtd/nand/nandsim.c
+++ b/
drivers/mtd/nand/nandsim.c
@@
-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);
}
}