hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/mtd/ubi/vtbl.c
....@@ -1,20 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (c) International Business Machines Corp., 2006
34 * Copyright (c) Nokia Corporation, 2006, 2007
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
13
- * the GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
185 *
196 * Author: Artem Bityutskiy (Битюцкий Артём)
207 */
....@@ -795,7 +782,7 @@
795782 */
796783 int ubi_read_volume_table(struct ubi_device *ubi, struct ubi_attach_info *ai)
797784 {
798
- int i, err;
785
+ int err;
799786 struct ubi_ainf_volume *av;
800787
801788 empty_vtbl_record.crc = cpu_to_be32(0xf116c36b);
....@@ -864,11 +851,7 @@
864851
865852 out_free:
866853 vfree(ubi->vtbl);
867
- for (i = 0; i < ubi->vtbl_slots + UBI_INT_VOL_COUNT; i++) {
868
- ubi_fastmap_destroy_checkmap(ubi->volumes[i]);
869
- kfree(ubi->volumes[i]);
870
- ubi->volumes[i] = NULL;
871
- }
854
+ ubi_free_all_volumes(ubi);
872855 return err;
873856 }
874857