diff options
author | shengyong <shengyong1@huawei.com> | 2015-05-26 10:07:08 +0000 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2015-06-02 11:44:43 +0200 |
commit | e8d266cf8d24e52eac65bdab24afd6f4cfc0ad07 (patch) | |
tree | f12cbdf3c55d777162c9cb323547cb528b29239f /drivers/mtd | |
parent | f6e951af34c515ffc69f4a557cf62533420c8ce4 (diff) | |
download | linux-e8d266cf8d24e52eac65bdab24afd6f4cfc0ad07.tar.bz2 |
UBI: Init vol->reserved_pebs by assignment
`vol' is a newly allocated value by kzalloc. Initialize it by assignment
instead of `+='.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/ubi/vmt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c index ff4d97848d1c..da2264b4faca 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c @@ -253,8 +253,8 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req) /* Calculate how many eraseblocks are requested */ vol->usable_leb_size = ubi->leb_size - ubi->leb_size % req->alignment; - vol->reserved_pebs += div_u64(req->bytes + vol->usable_leb_size - 1, - vol->usable_leb_size); + vol->reserved_pebs = div_u64(req->bytes + vol->usable_leb_size - 1, + vol->usable_leb_size); /* Reserve physical eraseblocks */ if (vol->reserved_pebs > ubi->avail_pebs) { |