diff options
Diffstat (limited to 'drivers/mtd/ubi/kapi.c')
-rw-r--r-- | drivers/mtd/ubi/kapi.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index c2fafe6fb2da..8e15002a36c3 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c | |||
@@ -162,15 +162,16 @@ struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode) | |||
162 | desc->mode = mode; | 162 | desc->mode = mode; |
163 | 163 | ||
164 | /* | 164 | /* |
165 | * To prevent simultaneous checks of the same volume we use @vtbl_mutex, | 165 | * To prevent simultaneous checks of the same volume we use |
166 | * although it is not the purpose it was introduced for. | 166 | * @volumes_mutex, although it is not the purpose it was introduced |
167 | * for. | ||
167 | */ | 168 | */ |
168 | mutex_lock(&ubi->vtbl_mutex); | 169 | mutex_lock(&ubi->volumes_mutex); |
169 | if (!vol->checked) { | 170 | if (!vol->checked) { |
170 | /* This is the first open - check the volume */ | 171 | /* This is the first open - check the volume */ |
171 | err = ubi_check_volume(ubi, vol_id); | 172 | err = ubi_check_volume(ubi, vol_id); |
172 | if (err < 0) { | 173 | if (err < 0) { |
173 | mutex_unlock(&ubi->vtbl_mutex); | 174 | mutex_unlock(&ubi->volumes_mutex); |
174 | ubi_close_volume(desc); | 175 | ubi_close_volume(desc); |
175 | return ERR_PTR(err); | 176 | return ERR_PTR(err); |
176 | } | 177 | } |
@@ -181,7 +182,7 @@ struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode) | |||
181 | } | 182 | } |
182 | vol->checked = 1; | 183 | vol->checked = 1; |
183 | } | 184 | } |
184 | mutex_unlock(&ubi->vtbl_mutex); | 185 | mutex_unlock(&ubi->volumes_mutex); |
185 | return desc; | 186 | return desc; |
186 | 187 | ||
187 | out_unlock: | 188 | out_unlock: |