Commit 9d6c4742 authored by Hou Tao's avatar Hou Tao Committed by Richard Weinberger
Browse files

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: default avatarHou Tao <houtao1@huawei.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 219b0e2c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;