Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc748d64 authored by shengyong's avatar shengyong Committed by Ian Maund
Browse files

UBI: Init vol->reserved_pebs by assignment



`vol' is a newly allocated value by kzalloc. Initialize it by assignment
instead of `+='.

Signed-off-by: default avatarSheng Yong <shengyong1@huawei.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Git-commit: e8d266cf8d24e52eac65bdab24afd6f4cfc0ad07
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Signed-off-by: default avatarNikhilesh Reddy <reddyn@codeaurora.org>
parent f2cb84fb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -253,7 +253,7 @@ 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->reserved_pebs = div_u64(req->bytes + vol->usable_leb_size - 1,
				     vol->usable_leb_size);

	/* Reserve physical eraseblocks */