Skip to content

Commit

Permalink
ubi: fix swapped arguments to call to ubi_alloc_aeb
Browse files Browse the repository at this point in the history
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: 91f4285 ("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>
  • Loading branch information
Colin Ian King authored and Richard Weinberger committed Oct 19, 2016
1 parent 843741c commit a15cf34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/ubi/fastmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a15cf34

Please sign in to comment.