diff options
Diffstat (limited to 'drivers/mtd/ubi/upd.c')
-rw-r--r-- | drivers/mtd/ubi/upd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/upd.c b/drivers/mtd/ubi/upd.c index a95dcaa4a0c..e32b04d2e04 100644 --- a/drivers/mtd/ubi/upd.c +++ b/drivers/mtd/ubi/upd.c @@ -67,7 +67,9 @@ static int set_update_marker(struct ubi_device *ubi, int vol_id) memcpy(&vtbl_rec, &ubi->vtbl[vol_id], sizeof(struct ubi_vtbl_record)); vtbl_rec.upd_marker = 1; + mutex_lock(&ubi->volumes_mutex); err = ubi_change_vtbl_record(ubi, vol_id, &vtbl_rec); + mutex_unlock(&ubi->volumes_mutex); vol->upd_marker = 1; return err; } @@ -106,7 +108,9 @@ static int clear_update_marker(struct ubi_device *ubi, int vol_id, long long byt vol->last_eb_bytes = vol->usable_leb_size; } + mutex_lock(&ubi->volumes_mutex); err = ubi_change_vtbl_record(ubi, vol_id, &vtbl_rec); + mutex_unlock(&ubi->volumes_mutex); vol->upd_marker = 0; return err; } |