]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ubi: fix swapped arguments to call to ubi_alloc_aeb
authorColin Ian King <colin.king@canonical.com>
Sat, 15 Oct 2016 16:00:11 +0000 (17:00 +0100)
committerRichard Weinberger <richard@nod.at>
Wed, 19 Oct 2016 22:06:00 +0000 (00:06 +0200)
Static analysis by CoverityScan detected the ec and pnum
arguments are in the wrong order on a call to ubi_alloc_aeb.
Swap the order to fix this.

Fixes: 91f4285fe389a27 ("UBI: provide helpers to allocate and free aeb elements")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/ubi/fastmap.c

index d6384d9657885c31c01e8fa1a5a2ed82530b0891..2ff62157d3bb0e6dfbe566ae0ffa898f3043a7ce 100644 (file)
@@ -287,7 +287,7 @@ static int update_vol(struct ubi_device *ubi, struct ubi_attach_info *ai,
 
                /* new_aeb is newer */
                if (cmp_res & 1) {
-                       victim = ubi_alloc_aeb(ai, aeb->ec, aeb->pnum);
+                       victim = ubi_alloc_aeb(ai, aeb->pnum, aeb->ec);
                        if (!victim)
                                return -ENOMEM;