projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
219b0e2
)
ubi: Check the presence of volume before call ubi_fastmap_destroy_checkmap()
author
Hou Tao
<houtao1@huawei.com>
Sat, 30 Nov 2019 09:48:00 +0000
(17:48 +0800)
committer
Richard Weinberger
<richard@nod.at>
Thu, 16 Jan 2020 22:35:48 +0000
(23:35 +0100)
Else there may be oops when fastmap is enabled and init_volumes() fails.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/ubi/vtbl.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/ubi/vtbl.c
b/drivers/mtd/ubi/vtbl.c
index
53d8ab5
..
8a2a0f0
100644
(file)
--- a/
drivers/mtd/ubi/vtbl.c
+++ b/
drivers/mtd/ubi/vtbl.c
@@
-852,6
+852,8
@@
int ubi_read_volume_table(struct ubi_device *ubi, struct ubi_attach_info *ai)
out_free:
vfree(ubi->vtbl);
for (i = 0; i < ubi->vtbl_slots + UBI_INT_VOL_COUNT; i++) {
+ if (!ubi->volumes[i])
+ continue;
ubi_fastmap_destroy_checkmap(ubi->volumes[i]);
kfree(ubi->volumes[i]);
ubi->volumes[i] = NULL;