btrfs-progs: fix compiler warning

gcc 4.9.0 gives a warning: array subscript is above array bounds

Checking for "greater or equal" instead of just "equal" fixes this.

The warning is a false positive, appears with -ftree-vrp, but we'd
rather fix it to avoid noise during build.

http://www.mail-archive.com/linux-btrfs%40vger.kernel.org/msg34338.html

Signed-off-by: Christian Hesse <mail@eworm.de>
Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
Christian Hesse 2014-06-03 13:29:19 +02:00 committed by David Sterba
parent 5ebf59ff58
commit 5bfc3fea81

View file

@ -176,7 +176,7 @@ again:
break;
}
if (level == BTRFS_MAX_LEVEL)
if (level >= BTRFS_MAX_LEVEL)
return 1;
slot = path->slots[level] + 1;