projects
/
platform
/
kernel
/
linux-starfive.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
|
history
diff --git
a/drivers/mtd/nand/nandsim.c
b/drivers/mtd/nand/nandsim.c
index
52c0c1a
..
6a74f62
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);
}
}