.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) International Business Machines Corp., 2006 |
---|
3 | 4 | * 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 |
---|
18 | 5 | * |
---|
19 | 6 | * Author: Artem Bityutskiy (Битюцкий Артём) |
---|
20 | 7 | */ |
---|
.. | .. |
---|
795 | 782 | */ |
---|
796 | 783 | int ubi_read_volume_table(struct ubi_device *ubi, struct ubi_attach_info *ai) |
---|
797 | 784 | { |
---|
798 | | - int i, err; |
---|
| 785 | + int err; |
---|
799 | 786 | struct ubi_ainf_volume *av; |
---|
800 | 787 | |
---|
801 | 788 | empty_vtbl_record.crc = cpu_to_be32(0xf116c36b); |
---|
.. | .. |
---|
864 | 851 | |
---|
865 | 852 | out_free: |
---|
866 | 853 | 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); |
---|
872 | 855 | return err; |
---|
873 | 856 | } |
---|
874 | 857 | |
---|