mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-15 09:34:17 +00:00
ubi: Check the presence of volume before call ubi_fastmap_destroy_checkmap()
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>
This commit is contained in:
parent
219b0e2cba
commit
9d6c4742f9
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user