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

Commit e8e6c875 authored by Dan Carpenter's avatar Dan Carpenter Committed by Brian Norris
Browse files

mtd: intflmount: fix off by one error in INFTL_dumpVUchains()



The ->PUtable[] array has "->nb_blocks" number of elemetns so this
comparison should be ">=" instead of ">".  Otherwise it could result in
a minor read beyond the end of an array.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent f02985b7
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -518,7 +518,7 @@ void INFTL_dumpVUchains(struct INFTLrecord *s)
	pr_debug("INFTL Virtual Unit Chains:\n");
	pr_debug("INFTL Virtual Unit Chains:\n");
	for (logical = 0; logical < s->nb_blocks; logical++) {
	for (logical = 0; logical < s->nb_blocks; logical++) {
		block = s->VUtable[logical];
		block = s->VUtable[logical];
		if (block > s->nb_blocks)
		if (block >= s->nb_blocks)
			continue;
			continue;
		pr_debug("  LOGICAL %d --> %d ", logical, block);
		pr_debug("  LOGICAL %d --> %d ", logical, block);
		for (i = 0; i < s->nb_blocks; i++) {
		for (i = 0; i < s->nb_blocks; i++) {